<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-name-shadowing #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE DataKinds #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE DeriveTraversable #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE LambdaCase #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE GADTs #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE KindSignatures #-}</span><span>
</span><span id="line-9"></span><span class="hs-pragma">{-# LANGUAGE StandaloneDeriving #-}</span><span>
</span><span id="line-10"></span><span class="hs-pragma">{-# LANGUAGE TupleSections #-}</span><span>
</span><span id="line-11"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-12"></span><span class="hs-pragma">{-# LANGUAGE TypeSynonymInstances #-}</span><span>
</span><span id="line-13"></span><span class="hs-pragma">{-# LANGUAGE ExplicitNamespaces #-}</span><span>
</span><span id="line-14"></span><span class="hs-pragma">{-# LANGUAGE RecordWildCards #-}</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- Module      :  GHC.Unit.Database</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2009, Duncan Coutts 2014</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- Maintainer  :  ghc-devs@haskell.org</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-23"></span><span class="hs-comment">--</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- This module provides the view of GHC's database of registered packages that</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- is shared between GHC the compiler\/library, and the ghc-pkg program. It</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- defines the database format that is shared between GHC and ghc-pkg.</span><span>
</span><span id="line-27"></span><span class="hs-comment">--</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- The database format, and this library are constructed so that GHC does not</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- have to depend on the Cabal library. The ghc-pkg program acts as the</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- gateway between the external package format (which is defined by Cabal) and</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- the internal package format which is specialised just for GHC.</span><span>
</span><span id="line-32"></span><span class="hs-comment">--</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- GHC the compiler only needs some of the information which is kept about</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- registered packages, such as module names, various paths etc. On the other</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- hand ghc-pkg has to keep all the information from Cabal packages and be able</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- to regurgitate it for users and other tools.</span><span>
</span><span id="line-37"></span><span class="hs-comment">--</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- The first trick is that we duplicate some of the information in the package</span><span>
</span><span id="line-39"></span><span class="hs-comment">-- database. We essentially keep two versions of the database in one file, one</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- version used only by ghc-pkg which keeps the full information (using the</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- serialised form of the 'InstalledPackageInfo' type defined by the Cabal</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- library); and a second version written by ghc-pkg and read by GHC which has</span><span>
</span><span id="line-43"></span><span class="hs-comment">-- just the subset of information that GHC needs.</span><span>
</span><span id="line-44"></span><span class="hs-comment">--</span><span>
</span><span id="line-45"></span><span class="hs-comment">-- The second trick is that this module only defines in detail the format of</span><span>
</span><span id="line-46"></span><span class="hs-comment">-- the second version -- the bit GHC uses -- and the part managed by ghc-pkg</span><span>
</span><span id="line-47"></span><span class="hs-comment">-- is kept in the file but here we treat it as an opaque blob of data. That way</span><span>
</span><span id="line-48"></span><span class="hs-comment">-- this library avoids depending on Cabal.</span><span>
</span><span id="line-49"></span><span class="hs-comment">--</span><span>
</span><span id="line-50"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Unit.Database</span><span>
</span><span id="line-51"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier">GenericUnitInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">type</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbUnitInfo"><span class="hs-identifier">DbUnitInfo</span></a></span><span>
</span><span id="line-53"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier">DbModule</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbInstUnitId"><span class="hs-identifier">DbInstUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#mapGenericUnitInfo"><span class="hs-identifier">mapGenericUnitInfo</span></a></span><span>
</span><span id="line-56"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Read and write</span></span><span>
</span><span id="line-57"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbMode"><span class="hs-identifier">DbMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier">DbOpenMode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#isDbOpenReadMode"><span class="hs-identifier">isDbOpenReadMode</span></a></span><span>
</span><span id="line-60"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#readPackageDbForGhc"><span class="hs-identifier">readPackageDbForGhc</span></a></span><span>
</span><span id="line-61"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#readPackageDbForGhcPkg"><span class="hs-identifier">readPackageDbForGhcPkg</span></a></span><span>
</span><span id="line-62"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#writePackageDb"><span class="hs-identifier">writePackageDb</span></a></span><span>
</span><span id="line-63"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Locking</span></span><span>
</span><span id="line-64"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier">PackageDbLock</span></a></span><span>
</span><span id="line-65"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#lockPackageDb"><span class="hs-identifier">lockPackageDb</span></a></span><span>
</span><span id="line-66"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#unlockPackageDb"><span class="hs-identifier">unlockPackageDb</span></a></span><span>
</span><span id="line-67"></span><span>   </span><span class="annot"><span class="hs-comment">-- * Misc</span></span><span>
</span><span id="line-68"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#mkMungePathUrl"><span class="hs-identifier">mkMungePathUrl</span></a></span><span>
</span><span id="line-69"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#mungeUnitInfoPaths"><span class="hs-identifier">mungeUnitInfoPaths</span></a></span><span>
</span><span id="line-70"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-71"></span><span class="hs-keyword">where</span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-comment">-- See note [Why do we import Prelude here?]</span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Version.html#"><span class="hs-identifier">Data.Version</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Version.html#Version"><span class="hs-identifier">Version</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS.Char8</span></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.html#"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS.Lazy</span></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#"><span class="hs-identifier">Data.ByteString.Lazy.Internal</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS.Lazy</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#defaultChunkSize"><span class="hs-identifier">defaultChunkSize</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#"><span class="hs-identifier">Data.Foldable</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">F</span></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#"><span class="hs-identifier">Data.Traversable</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">F</span></span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bifunctor.html#"><span class="hs-identifier">Data.Bifunctor</span></a></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.html#"><span class="hs-identifier">Data.Binary</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Bin</span></span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#"><span class="hs-identifier">Data.Binary.Put</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Bin</span></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.html#"><span class="hs-identifier">Data.Binary.Get</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Bin</span></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Exception</span></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier">when</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">FilePath</span></span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.Posix.html#"><span class="hs-identifier">System.FilePath.Posix</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">FilePath.Posix</span></span><span>
</span><span id="line-89"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-90"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#"><span class="hs-identifier">System.IO.Error</span></a></span><span>
</span><span id="line-91"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#"><span class="hs-identifier">GHC.IO.Exception</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOErrorType"><span class="hs-identifier">IOErrorType</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#InappropriateType"><span class="hs-identifier">InappropriateType</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Lock.html#"><span class="hs-identifier">GHC.IO.Handle.Lock</span></a></span><span>
</span><span id="line-93"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-94"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.OldList.html#stripPrefix"><span class="hs-identifier">stripPrefix</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- | @ghc-boot@'s UnitInfo, serialized to the database.</span><span>
</span><span id="line-97"></span><span class="hs-keyword">type</span><span> </span><span id="DbUnitInfo"><span class="annot"><a href="GHC.Unit.Database.html#DbUnitInfo"><span class="hs-identifier hs-var">DbUnitInfo</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier hs-type">DbModule</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-comment">-- | Information about an unit (a unit is an installed module library).</span><span>
</span><span id="line-100"></span><span class="hs-comment">--</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- This is a subset of Cabal's 'InstalledPackageInfo', with just the bits</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- that GHC is interested in.</span><span>
</span><span id="line-103"></span><span class="hs-comment">--</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- Some types are left as parameters to be instantiated differently in ghc-pkg</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- and in ghc itself.</span><span>
</span><span id="line-106"></span><span class="hs-comment">--</span><span>
</span><span id="line-107"></span><span class="hs-keyword">data</span><span> </span><span id="GenericUnitInfo"><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-var">GenericUnitInfo</span></a></span></span><span> </span><span id="local-6989586621679061077"><span class="annot"><a href="#local-6989586621679061077"><span class="hs-identifier hs-type">compid</span></a></span></span><span> </span><span id="local-6989586621679061076"><span class="annot"><a href="#local-6989586621679061076"><span class="hs-identifier hs-type">srcpkgid</span></a></span></span><span> </span><span id="local-6989586621679061075"><span class="annot"><a href="#local-6989586621679061075"><span class="hs-identifier hs-type">srcpkgname</span></a></span></span><span> </span><span id="local-6989586621679061074"><span class="annot"><a href="#local-6989586621679061074"><span class="hs-identifier hs-type">uid</span></a></span></span><span> </span><span id="local-6989586621679061073"><span class="annot"><a href="#local-6989586621679061073"><span class="hs-identifier hs-type">modulename</span></a></span></span><span> </span><span id="local-6989586621679061072"><span class="annot"><a href="#local-6989586621679061072"><span class="hs-identifier hs-type">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="GenericUnitInfo"><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-var">GenericUnitInfo</span></a></span></span><span>
</span><span id="line-108"></span><span>   </span><span class="hs-special">{</span><span> </span><span id="unitId"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; uid
</span><a href="GHC.Unit.Database.html#unitId"><span class="hs-identifier hs-var hs-var">unitId</span></a></span></span><span>             </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679061074"><span class="hs-identifier hs-type">uid</span></a></span><span>
</span><span id="line-109"></span><span>      </span><span class="hs-comment">-- ^ Unique unit identifier that is used during compilation (e.g. to</span><span>
</span><span id="line-110"></span><span>      </span><span class="hs-comment">-- generate symbols).</span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitInstanceOf"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; compid
</span><a href="GHC.Unit.Database.html#unitInstanceOf"><span class="hs-identifier hs-var hs-var">unitInstanceOf</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679061077"><span class="hs-identifier hs-type">compid</span></a></span><span>
</span><span id="line-113"></span><span>      </span><span class="hs-comment">-- ^ Identifier of an indefinite unit (i.e. with module holes) that this</span><span>
</span><span id="line-114"></span><span>      </span><span class="hs-comment">-- unit is an instance of.</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitInstantiations"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [(modulename, mod)]
</span><a href="GHC.Unit.Database.html#unitInstantiations"><span class="hs-identifier hs-var hs-var">unitInstantiations</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679061073"><span class="hs-identifier hs-type">modulename</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679061072"><span class="hs-identifier hs-type">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-117"></span><span>      </span><span class="hs-comment">-- ^ How this unit instantiates some of its module holes. Map hole module</span><span>
</span><span id="line-118"></span><span>      </span><span class="hs-comment">-- names to actual module</span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitPackageId"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; srcpkgid
</span><a href="GHC.Unit.Database.html#unitPackageId"><span class="hs-identifier hs-var hs-var">unitPackageId</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679061076"><span class="hs-identifier hs-type">srcpkgid</span></a></span><span>
</span><span id="line-121"></span><span>      </span><span class="hs-comment">-- ^ Source package identifier.</span><span>
</span><span id="line-122"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-123"></span><span>      </span><span class="hs-comment">-- Cabal instantiates this with Distribution.Types.PackageId.PackageId</span><span>
</span><span id="line-124"></span><span>      </span><span class="hs-comment">-- type which only contains the source package name and version. Notice</span><span>
</span><span id="line-125"></span><span>      </span><span class="hs-comment">-- that it doesn't contain the Hackage revision, nor any kind of hash.</span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitPackageName"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; srcpkgname
</span><a href="GHC.Unit.Database.html#unitPackageName"><span class="hs-identifier hs-var hs-var">unitPackageName</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679061075"><span class="hs-identifier hs-type">srcpkgname</span></a></span><span>
</span><span id="line-128"></span><span>      </span><span class="hs-comment">-- ^ Source package name</span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitPackageVersion"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Version
</span><a href="GHC.Unit.Database.html#unitPackageVersion"><span class="hs-identifier hs-var hs-var">unitPackageVersion</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Version.html#Version"><span class="hs-identifier hs-type">Version</span></a></span><span>
</span><span id="line-131"></span><span>      </span><span class="hs-comment">-- ^ Source package version</span><span>
</span><span id="line-132"></span><span>
</span><span id="line-133"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitComponentName"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Maybe srcpkgname
</span><a href="GHC.Unit.Database.html#unitComponentName"><span class="hs-identifier hs-var hs-var">unitComponentName</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679061075"><span class="hs-identifier hs-type">srcpkgname</span></a></span><span>
</span><span id="line-134"></span><span>      </span><span class="hs-comment">-- ^ Name of the component.</span><span>
</span><span id="line-135"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-136"></span><span>      </span><span class="hs-comment">-- Cabal supports more than one components (libraries, executables,</span><span>
</span><span id="line-137"></span><span>      </span><span class="hs-comment">-- testsuites) in the same package. Each component has a name except the</span><span>
</span><span id="line-138"></span><span>      </span><span class="hs-comment">-- default one (that can only be a library component) for which we use</span><span>
</span><span id="line-139"></span><span>      </span><span class="hs-comment">-- &quot;Nothing&quot;.</span><span>
</span><span id="line-140"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-141"></span><span>      </span><span class="hs-comment">-- GHC only deals with &quot;library&quot; components as they are the only kind of</span><span>
</span><span id="line-142"></span><span>      </span><span class="hs-comment">-- components that can be registered in a database and used by other</span><span>
</span><span id="line-143"></span><span>      </span><span class="hs-comment">-- modules.</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitAbiHash"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; String
</span><a href="GHC.Unit.Database.html#unitAbiHash"><span class="hs-identifier hs-var hs-var">unitAbiHash</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-146"></span><span>      </span><span class="hs-comment">-- ^ ABI hash used to avoid mixing up units compiled with different</span><span>
</span><span id="line-147"></span><span>      </span><span class="hs-comment">-- dependencies, compiler, options, etc.</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitDepends"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [uid]
</span><a href="GHC.Unit.Database.html#unitDepends"><span class="hs-identifier hs-var hs-var">unitDepends</span></a></span></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679061074"><span class="hs-identifier hs-type">uid</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-150"></span><span>      </span><span class="hs-comment">-- ^ Identifiers of the units this one depends on</span><span>
</span><span id="line-151"></span><span>
</span><span id="line-152"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitAbiDepends"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [(uid, String)]
</span><a href="GHC.Unit.Database.html#unitAbiDepends"><span class="hs-identifier hs-var hs-var">unitAbiDepends</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679061074"><span class="hs-identifier hs-type">uid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-153"></span><span>     </span><span class="hs-comment">-- ^ Like 'unitDepends', but each dependency is annotated with the ABI hash</span><span>
</span><span id="line-154"></span><span>     </span><span class="hs-comment">-- we expect the dependency to respect.</span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitImportDirs"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitImportDirs"><span class="hs-identifier hs-var hs-var">unitImportDirs</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-157"></span><span>      </span><span class="hs-comment">-- ^ Directories containing module interfaces</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitLibraries"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitLibraries"><span class="hs-identifier hs-var hs-var">unitLibraries</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-160"></span><span>      </span><span class="hs-comment">-- ^ Names of the Haskell libraries provided by this unit</span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitExtDepLibsSys"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitExtDepLibsSys"><span class="hs-identifier hs-var hs-var">unitExtDepLibsSys</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-163"></span><span>      </span><span class="hs-comment">-- ^ Names of the external system libraries that this unit depends on. See</span><span>
</span><span id="line-164"></span><span>      </span><span class="hs-comment">-- also `unitExtDepLibsGhc` field.</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitExtDepLibsGhc"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitExtDepLibsGhc"><span class="hs-identifier hs-var hs-var">unitExtDepLibsGhc</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-167"></span><span>      </span><span class="hs-comment">-- ^ Because of slight differences between the GHC dynamic linker (in</span><span>
</span><span id="line-168"></span><span>      </span><span class="hs-comment">-- GHC.Runtime.Linker) and the</span><span>
</span><span id="line-169"></span><span>      </span><span class="hs-comment">-- native system linker, some packages have to link with a different list</span><span>
</span><span id="line-170"></span><span>      </span><span class="hs-comment">-- of libraries when using GHC's. Examples include: libs that are actually</span><span>
</span><span id="line-171"></span><span>      </span><span class="hs-comment">-- gnu ld scripts, and the possibility that the .a libs do not exactly</span><span>
</span><span id="line-172"></span><span>      </span><span class="hs-comment">-- match the .so/.dll equivalents.</span><span>
</span><span id="line-173"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-174"></span><span>      </span><span class="hs-comment">-- If this field is set, then we use that instead of the</span><span>
</span><span id="line-175"></span><span>      </span><span class="hs-comment">-- `unitExtDepLibsSys` field.</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitLibraryDirs"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitLibraryDirs"><span class="hs-identifier hs-var hs-var">unitLibraryDirs</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-178"></span><span>      </span><span class="hs-comment">-- ^ Directories containing libraries provided by this unit. See also</span><span>
</span><span id="line-179"></span><span>      </span><span class="hs-comment">-- `unitLibraryDynDirs`.</span><span>
</span><span id="line-180"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-181"></span><span>      </span><span class="hs-comment">-- It seems to be used to store paths to external library dependencies</span><span>
</span><span id="line-182"></span><span>      </span><span class="hs-comment">-- too.</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitLibraryDynDirs"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitLibraryDynDirs"><span class="hs-identifier hs-var hs-var">unitLibraryDynDirs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-185"></span><span>      </span><span class="hs-comment">-- ^ Directories containing the dynamic libraries provided by this unit.</span><span>
</span><span id="line-186"></span><span>      </span><span class="hs-comment">-- See also `unitLibraryDirs`.</span><span>
</span><span id="line-187"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-188"></span><span>      </span><span class="hs-comment">-- It seems to be used to store paths to external dynamic library</span><span>
</span><span id="line-189"></span><span>      </span><span class="hs-comment">-- dependencies too.</span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitExtDepFrameworks"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitExtDepFrameworks"><span class="hs-identifier hs-var hs-var">unitExtDepFrameworks</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-192"></span><span>      </span><span class="hs-comment">-- ^ Names of the external MacOS frameworks that this unit depends on.</span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitExtDepFrameworkDirs"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitExtDepFrameworkDirs"><span class="hs-identifier hs-var hs-var">unitExtDepFrameworkDirs</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-195"></span><span>      </span><span class="hs-comment">-- ^ Directories containing MacOS frameworks that this unit depends</span><span>
</span><span id="line-196"></span><span>      </span><span class="hs-comment">-- on.</span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitLinkerOptions"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitLinkerOptions"><span class="hs-identifier hs-var hs-var">unitLinkerOptions</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-199"></span><span>      </span><span class="hs-comment">-- ^ Linker (e.g. ld) command line options</span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitCcOptions"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitCcOptions"><span class="hs-identifier hs-var hs-var">unitCcOptions</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-202"></span><span>      </span><span class="hs-comment">-- ^ C compiler options that needs to be passed to the C compiler when we</span><span>
</span><span id="line-203"></span><span>      </span><span class="hs-comment">-- compile some C code against this unit.</span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitIncludes"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitIncludes"><span class="hs-identifier hs-var hs-var">unitIncludes</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-206"></span><span>      </span><span class="hs-comment">-- ^ C header files that are required by this unit (provided by this unit</span><span>
</span><span id="line-207"></span><span>      </span><span class="hs-comment">-- or external)</span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitIncludeDirs"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitIncludeDirs"><span class="hs-identifier hs-var hs-var">unitIncludeDirs</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-210"></span><span>      </span><span class="hs-comment">-- ^ Directories containing C header files that this unit depends</span><span>
</span><span id="line-211"></span><span>      </span><span class="hs-comment">-- on.</span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitHaddockInterfaces"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitHaddockInterfaces"><span class="hs-identifier hs-var hs-var">unitHaddockInterfaces</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-214"></span><span>      </span><span class="hs-comment">-- ^ Paths to Haddock interface files for this unit</span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitHaddockHTMLs"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitHaddockHTMLs"><span class="hs-identifier hs-var hs-var">unitHaddockHTMLs</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-217"></span><span>      </span><span class="hs-comment">-- ^ Paths to Haddock directories containing HTML files</span><span>
</span><span id="line-218"></span><span>
</span><span id="line-219"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitExposedModules"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [(modulename, Maybe mod)]
</span><a href="GHC.Unit.Database.html#unitExposedModules"><span class="hs-identifier hs-var hs-var">unitExposedModules</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679061073"><span class="hs-identifier hs-type">modulename</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679061072"><span class="hs-identifier hs-type">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-220"></span><span>      </span><span class="hs-comment">-- ^ Modules exposed by the unit.</span><span>
</span><span id="line-221"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-222"></span><span>      </span><span class="hs-comment">-- A module can be re-exported from another package. In this case, we</span><span>
</span><span id="line-223"></span><span>      </span><span class="hs-comment">-- indicate the module origin in the second parameter.</span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitHiddenModules"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [modulename]
</span><a href="GHC.Unit.Database.html#unitHiddenModules"><span class="hs-identifier hs-var hs-var">unitHiddenModules</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679061073"><span class="hs-identifier hs-type">modulename</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-226"></span><span>      </span><span class="hs-comment">-- ^ Hidden modules.</span><span>
</span><span id="line-227"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-228"></span><span>      </span><span class="hs-comment">-- These are useful for error reporting (e.g. if a hidden module is</span><span>
</span><span id="line-229"></span><span>      </span><span class="hs-comment">-- imported)</span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitIsIndefinite"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
</span><a href="GHC.Unit.Database.html#unitIsIndefinite"><span class="hs-identifier hs-var hs-var">unitIsIndefinite</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-232"></span><span>      </span><span class="hs-comment">-- ^ True if this unit has some module holes that need to be instantiated</span><span>
</span><span id="line-233"></span><span>      </span><span class="hs-comment">-- with real modules to make the unit usable (a.k.a. Backpack).</span><span>
</span><span id="line-234"></span><span>
</span><span id="line-235"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitIsExposed"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
</span><a href="GHC.Unit.Database.html#unitIsExposed"><span class="hs-identifier hs-var hs-var">unitIsExposed</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-236"></span><span>      </span><span class="hs-comment">-- ^ True if the unit is exposed. A unit could be installed in a database</span><span>
</span><span id="line-237"></span><span>      </span><span class="hs-comment">-- by &quot;disabled&quot; by not being exposed.</span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span>   </span><span class="hs-special">,</span><span> </span><span id="unitIsTrusted"><span class="annot"><span class="annottext">forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
</span><a href="GHC.Unit.Database.html#unitIsTrusted"><span class="hs-identifier hs-var hs-var">unitIsTrusted</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-240"></span><span>      </span><span class="hs-comment">-- ^ True if the unit is trusted (cf Safe Haskell)</span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span>   </span><span class="hs-special">}</span><span>
</span><span id="line-243"></span><span>   </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679060509"><span id="local-6989586621679060548"><span class="annot"><span class="annottext">GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
(GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
 -&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
 -&gt; Bool)
-&gt; (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
    -&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
    -&gt; Bool)
-&gt; Eq
     (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod)
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
forall compid srcpkgid srcpkgname uid modulename mod.
(Eq uid, Eq compid, Eq modulename, Eq mod, Eq srcpkgid,
 Eq srcpkgname) =&gt;
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
/= :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
$c/= :: forall compid srcpkgid srcpkgname uid modulename mod.
(Eq uid, Eq compid, Eq modulename, Eq mod, Eq srcpkgid,
 Eq srcpkgname) =&gt;
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
== :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
$c== :: forall compid srcpkgid srcpkgname uid modulename mod.
(Eq uid, Eq compid, Eq modulename, Eq mod, Eq srcpkgid,
 Eq srcpkgname) =&gt;
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679060460"><span id="local-6989586621679060462"><span id="local-6989586621679060503"><span class="annot"><span class="annottext">Int
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; ShowS
[GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod]
-&gt; ShowS
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; String
(Int
 -&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
 -&gt; ShowS)
-&gt; (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
    -&gt; String)
-&gt; ([GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod]
    -&gt; ShowS)
-&gt; Show
     (GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod)
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
forall compid srcpkgid srcpkgname uid modulename mod.
(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid,
 Show srcpkgname) =&gt;
Int
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; ShowS
forall compid srcpkgid srcpkgname uid modulename mod.
(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid,
 Show srcpkgname) =&gt;
[GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod]
-&gt; ShowS
forall compid srcpkgid srcpkgname uid modulename mod.
(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid,
 Show srcpkgname) =&gt;
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; String
showList :: [GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod]
-&gt; ShowS
$cshowList :: forall compid srcpkgid srcpkgname uid modulename mod.
(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid,
 Show srcpkgname) =&gt;
[GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod]
-&gt; ShowS
show :: GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; String
$cshow :: forall compid srcpkgid srcpkgname uid modulename mod.
(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid,
 Show srcpkgname) =&gt;
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; String
showsPrec :: Int
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; ShowS
$cshowsPrec :: forall compid srcpkgid srcpkgname uid modulename mod.
(Show uid, Show compid, Show modulename, Show mod, Show srcpkgid,
 Show srcpkgname) =&gt;
Int
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-244"></span><span>
</span><span id="line-245"></span><span class="hs-comment">-- | Convert between GenericUnitInfo instances</span><span>
</span><span id="line-246"></span><span id="local-6989586621679060874"><span id="local-6989586621679060875"><span id="local-6989586621679060876"><span id="local-6989586621679060877"><span id="local-6989586621679060878"><span id="local-6989586621679060879"><span id="local-6989586621679060880"><span id="local-6989586621679060881"><span id="local-6989586621679060882"><span id="local-6989586621679060883"><span id="local-6989586621679060884"><span id="local-6989586621679060885"><span class="annot"><a href="GHC.Unit.Database.html#mapGenericUnitInfo"><span class="hs-identifier hs-type">mapGenericUnitInfo</span></a></span><span>
</span><span id="line-247"></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060885"><span class="hs-identifier hs-type">uid1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679060884"><span class="hs-identifier hs-type">uid2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060883"><span class="hs-identifier hs-type">cid1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679060882"><span class="hs-identifier hs-type">cid2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-249"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060881"><span class="hs-identifier hs-type">srcpkg1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679060880"><span class="hs-identifier hs-type">srcpkg2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060879"><span class="hs-identifier hs-type">srcpkgname1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679060878"><span class="hs-identifier hs-type">srcpkgname2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060877"><span class="hs-identifier hs-type">modname1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679060876"><span class="hs-identifier hs-type">modname2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-252"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060875"><span class="hs-identifier hs-type">mod1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679060874"><span class="hs-identifier hs-type">mod2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-253"></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060883"><span class="hs-identifier hs-type">cid1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060881"><span class="hs-identifier hs-type">srcpkg1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060879"><span class="hs-identifier hs-type">srcpkgname1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060885"><span class="hs-identifier hs-type">uid1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060877"><span class="hs-identifier hs-type">modname1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060875"><span class="hs-identifier hs-type">mod1</span></a></span><span>
</span><span id="line-254"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060882"><span class="hs-identifier hs-type">cid2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060880"><span class="hs-identifier hs-type">srcpkg2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060878"><span class="hs-identifier hs-type">srcpkgname2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060884"><span class="hs-identifier hs-type">uid2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060876"><span class="hs-identifier hs-type">modname2</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060874"><span class="hs-identifier hs-type">mod2</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span></span></span></span></span></span></span><span>
</span><span id="line-255"></span><span id="mapGenericUnitInfo"><span class="annot"><span class="annottext">mapGenericUnitInfo :: forall uid1 uid2 cid1 cid2 srcpkg1 srcpkg2 srcpkgname1 srcpkgname2
       modname1 modname2 mod1 mod2.
(uid1 -&gt; uid2)
-&gt; (cid1 -&gt; cid2)
-&gt; (srcpkg1 -&gt; srcpkg2)
-&gt; (srcpkgname1 -&gt; srcpkgname2)
-&gt; (modname1 -&gt; modname2)
-&gt; (mod1 -&gt; mod2)
-&gt; GenericUnitInfo cid1 srcpkg1 srcpkgname1 uid1 modname1 mod1
-&gt; GenericUnitInfo cid2 srcpkg2 srcpkgname2 uid2 modname2 mod2
</span><a href="GHC.Unit.Database.html#mapGenericUnitInfo"><span class="hs-identifier hs-var hs-var">mapGenericUnitInfo</span></a></span></span><span> </span><span id="local-6989586621679060442"><span class="annot"><span class="annottext">uid1 -&gt; uid2
</span><a href="#local-6989586621679060442"><span class="hs-identifier hs-var">fuid</span></a></span></span><span> </span><span id="local-6989586621679060441"><span class="annot"><span class="annottext">cid1 -&gt; cid2
</span><a href="#local-6989586621679060441"><span class="hs-identifier hs-var">fcid</span></a></span></span><span> </span><span id="local-6989586621679060440"><span class="annot"><span class="annottext">srcpkg1 -&gt; srcpkg2
</span><a href="#local-6989586621679060440"><span class="hs-identifier hs-var">fsrcpkg</span></a></span></span><span> </span><span id="local-6989586621679060439"><span class="annot"><span class="annottext">srcpkgname1 -&gt; srcpkgname2
</span><a href="#local-6989586621679060439"><span class="hs-identifier hs-var">fsrcpkgname</span></a></span></span><span> </span><span id="local-6989586621679060438"><span class="annot"><span class="annottext">modname1 -&gt; modname2
</span><a href="#local-6989586621679060438"><span class="hs-identifier hs-var">fmodname</span></a></span></span><span> </span><span id="local-6989586621679060437"><span class="annot"><span class="annottext">mod1 -&gt; mod2
</span><a href="#local-6989586621679060437"><span class="hs-identifier hs-var">fmod</span></a></span></span><span> </span><span id="local-6989586621679060436"><span class="annot"><span class="annottext">g :: GenericUnitInfo cid1 srcpkg1 srcpkgname1 uid1 modname1 mod1
</span><a href="#local-6989586621679060436"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span> </span><span class="hs-special">{</span><span id="local-6989586621679060407"><span id="local-6989586621679060408"><span id="local-6989586621679060409"><span id="local-6989586621679060410"><span id="local-6989586621679060411"><span id="local-6989586621679060412"><span id="local-6989586621679060413"><span id="local-6989586621679060414"><span id="local-6989586621679060415"><span id="local-6989586621679060416"><span id="local-6989586621679060417"><span id="local-6989586621679060418"><span id="local-6989586621679060419"><span id="local-6989586621679060420"><span id="local-6989586621679060421"><span id="local-6989586621679060422"><span id="local-6989586621679060423"><span id="local-6989586621679060424"><span id="local-6989586621679060425"><span id="local-6989586621679060426"><span id="local-6989586621679060427"><span id="local-6989586621679060428"><span id="local-6989586621679060429"><span id="local-6989586621679060430"><span id="local-6989586621679060431"><span id="local-6989586621679060432"><span id="local-6989586621679060433"><span id="local-6989586621679060434"><span id="local-6989586621679060435"><span class="annot"><span class="annottext">uid1
cid1
srcpkg1
srcpkgname1
Bool
[uid1]
[modname1]
String
[String]
[(uid1, String)]
[(modname1, mod1)]
[(modname1, Maybe mod1)]
Maybe srcpkgname1
Version
unitIsTrusted :: Bool
unitIsExposed :: Bool
unitIsIndefinite :: Bool
unitHiddenModules :: [modname1]
unitExposedModules :: [(modname1, Maybe mod1)]
unitHaddockHTMLs :: [String]
unitHaddockInterfaces :: [String]
unitIncludeDirs :: [String]
unitIncludes :: [String]
unitCcOptions :: [String]
unitLinkerOptions :: [String]
unitExtDepFrameworkDirs :: [String]
unitExtDepFrameworks :: [String]
unitLibraryDynDirs :: [String]
unitLibraryDirs :: [String]
unitExtDepLibsGhc :: [String]
unitExtDepLibsSys :: [String]
unitLibraries :: [String]
unitImportDirs :: [String]
unitAbiDepends :: [(uid1, String)]
unitDepends :: [uid1]
unitAbiHash :: String
unitComponentName :: Maybe srcpkgname1
unitPackageVersion :: Version
unitPackageName :: srcpkgname1
unitPackageId :: srcpkg1
unitInstantiations :: [(modname1, mod1)]
unitInstanceOf :: cid1
unitId :: uid1
unitIsTrusted :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
unitIsExposed :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
unitIsIndefinite :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Bool
unitHiddenModules :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [modulename]
unitExposedModules :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [(modulename, Maybe mod)]
unitHaddockHTMLs :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitHaddockInterfaces :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitIncludeDirs :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitIncludes :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitCcOptions :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitLinkerOptions :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitExtDepFrameworkDirs :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitExtDepFrameworks :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitLibraryDynDirs :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitLibraryDirs :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitExtDepLibsGhc :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitExtDepLibsSys :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitLibraries :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitImportDirs :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
unitAbiDepends :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [(uid, String)]
unitDepends :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [uid]
unitAbiHash :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; String
unitComponentName :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Maybe srcpkgname
unitPackageVersion :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; Version
unitPackageName :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; srcpkgname
unitPackageId :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; srcpkgid
unitInstantiations :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [(modulename, mod)]
unitInstanceOf :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; compid
unitId :: forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; uid
</span><a href="#local-6989586621679060407"><span class="hs-glyph hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">..</span></a></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-256"></span><span>   </span><span class="annot"><span class="annottext">GenericUnitInfo cid1 srcpkg1 srcpkgname1 uid1 modname1 mod1
</span><a href="#local-6989586621679060436"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">unitId :: uid2
</span><a href="GHC.Unit.Database.html#unitId"><span class="hs-identifier hs-var">unitId</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">uid1 -&gt; uid2
</span><a href="#local-6989586621679060442"><span class="hs-identifier hs-var">fuid</span></a></span><span> </span><span class="annot"><span class="annottext">uid1
</span><a href="#local-6989586621679060435"><span class="hs-identifier hs-var">unitId</span></a></span><span>
</span><span id="line-257"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitInstanceOf :: cid2
</span><a href="GHC.Unit.Database.html#unitInstanceOf"><span class="hs-identifier hs-var">unitInstanceOf</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">cid1 -&gt; cid2
</span><a href="#local-6989586621679060441"><span class="hs-identifier hs-var">fcid</span></a></span><span> </span><span class="annot"><span class="annottext">cid1
</span><a href="#local-6989586621679060434"><span class="hs-identifier hs-var">unitInstanceOf</span></a></span><span>
</span><span id="line-258"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitInstantiations :: [(modname2, mod2)]
</span><a href="GHC.Unit.Database.html#unitInstantiations"><span class="hs-identifier hs-var">unitInstantiations</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((modname1, mod1) -&gt; (modname2, mod2))
-&gt; [(modname1, mod1)] -&gt; [(modname2, mod2)]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(modname1 -&gt; modname2)
-&gt; (mod1 -&gt; mod2) -&gt; (modname1, mod1) -&gt; (modname2, mod2)
forall (p :: * -&gt; * -&gt; *) a b c d.
Bifunctor p =&gt;
(a -&gt; b) -&gt; (c -&gt; d) -&gt; p a c -&gt; p b d
</span><a href="../../base/src/Data.Bifunctor.html#bimap"><span class="hs-identifier hs-var">bimap</span></a></span><span> </span><span class="annot"><span class="annottext">modname1 -&gt; modname2
</span><a href="#local-6989586621679060438"><span class="hs-identifier hs-var">fmodname</span></a></span><span> </span><span class="annot"><span class="annottext">mod1 -&gt; mod2
</span><a href="#local-6989586621679060437"><span class="hs-identifier hs-var">fmod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(modname1, mod1)]
</span><a href="#local-6989586621679060433"><span class="hs-identifier hs-var">unitInstantiations</span></a></span><span>
</span><span id="line-259"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitPackageId :: srcpkg2
</span><a href="GHC.Unit.Database.html#unitPackageId"><span class="hs-identifier hs-var">unitPackageId</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">srcpkg1 -&gt; srcpkg2
</span><a href="#local-6989586621679060440"><span class="hs-identifier hs-var">fsrcpkg</span></a></span><span> </span><span class="annot"><span class="annottext">srcpkg1
</span><a href="#local-6989586621679060432"><span class="hs-identifier hs-var">unitPackageId</span></a></span><span>
</span><span id="line-260"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitPackageName :: srcpkgname2
</span><a href="GHC.Unit.Database.html#unitPackageName"><span class="hs-identifier hs-var">unitPackageName</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">srcpkgname1 -&gt; srcpkgname2
</span><a href="#local-6989586621679060439"><span class="hs-identifier hs-var">fsrcpkgname</span></a></span><span> </span><span class="annot"><span class="annottext">srcpkgname1
</span><a href="#local-6989586621679060431"><span class="hs-identifier hs-var">unitPackageName</span></a></span><span>
</span><span id="line-261"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitComponentName :: Maybe srcpkgname2
</span><a href="GHC.Unit.Database.html#unitComponentName"><span class="hs-identifier hs-var">unitComponentName</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(srcpkgname1 -&gt; srcpkgname2)
-&gt; Maybe srcpkgname1 -&gt; Maybe srcpkgname2
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">srcpkgname1 -&gt; srcpkgname2
</span><a href="#local-6989586621679060439"><span class="hs-identifier hs-var">fsrcpkgname</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe srcpkgname1
</span><a href="#local-6989586621679060429"><span class="hs-identifier hs-var">unitComponentName</span></a></span><span>
</span><span id="line-262"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitDepends :: [uid2]
</span><a href="GHC.Unit.Database.html#unitDepends"><span class="hs-identifier hs-var">unitDepends</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(uid1 -&gt; uid2) -&gt; [uid1] -&gt; [uid2]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">uid1 -&gt; uid2
</span><a href="#local-6989586621679060442"><span class="hs-identifier hs-var">fuid</span></a></span><span> </span><span class="annot"><span class="annottext">[uid1]
</span><a href="#local-6989586621679060427"><span class="hs-identifier hs-var">unitDepends</span></a></span><span>
</span><span id="line-263"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitAbiDepends :: [(uid2, String)]
</span><a href="GHC.Unit.Database.html#unitAbiDepends"><span class="hs-identifier hs-var">unitAbiDepends</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((uid1, String) -&gt; (uid2, String))
-&gt; [(uid1, String)] -&gt; [(uid2, String)]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(uid1 -&gt; uid2) -&gt; (uid1, String) -&gt; (uid2, String)
forall (p :: * -&gt; * -&gt; *) a b c.
Bifunctor p =&gt;
(a -&gt; b) -&gt; p a c -&gt; p b c
</span><a href="../../base/src/Data.Bifunctor.html#first"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="annot"><span class="annottext">uid1 -&gt; uid2
</span><a href="#local-6989586621679060442"><span class="hs-identifier hs-var">fuid</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(uid1, String)]
</span><a href="#local-6989586621679060426"><span class="hs-identifier hs-var">unitAbiDepends</span></a></span><span>
</span><span id="line-264"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitExposedModules :: [(modname2, Maybe mod2)]
</span><a href="GHC.Unit.Database.html#unitExposedModules"><span class="hs-identifier hs-var">unitExposedModules</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((modname1, Maybe mod1) -&gt; (modname2, Maybe mod2))
-&gt; [(modname1, Maybe mod1)] -&gt; [(modname2, Maybe mod2)]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(modname1 -&gt; modname2)
-&gt; (Maybe mod1 -&gt; Maybe mod2)
-&gt; (modname1, Maybe mod1)
-&gt; (modname2, Maybe mod2)
forall (p :: * -&gt; * -&gt; *) a b c d.
Bifunctor p =&gt;
(a -&gt; b) -&gt; (c -&gt; d) -&gt; p a c -&gt; p b d
</span><a href="../../base/src/Data.Bifunctor.html#bimap"><span class="hs-identifier hs-var">bimap</span></a></span><span> </span><span class="annot"><span class="annottext">modname1 -&gt; modname2
</span><a href="#local-6989586621679060438"><span class="hs-identifier hs-var">fmodname</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(mod1 -&gt; mod2) -&gt; Maybe mod1 -&gt; Maybe mod2
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">mod1 -&gt; mod2
</span><a href="#local-6989586621679060437"><span class="hs-identifier hs-var">fmod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(modname1, Maybe mod1)]
</span><a href="#local-6989586621679060411"><span class="hs-identifier hs-var">unitExposedModules</span></a></span><span>
</span><span id="line-265"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitHiddenModules :: [modname2]
</span><a href="GHC.Unit.Database.html#unitHiddenModules"><span class="hs-identifier hs-var">unitHiddenModules</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(modname1 -&gt; modname2) -&gt; [modname1] -&gt; [modname2]
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">modname1 -&gt; modname2
</span><a href="#local-6989586621679060438"><span class="hs-identifier hs-var">fmodname</span></a></span><span> </span><span class="annot"><span class="annottext">[modname1]
</span><a href="#local-6989586621679060410"><span class="hs-identifier hs-var">unitHiddenModules</span></a></span><span>
</span><span id="line-266"></span><span>     </span><span class="hs-special">}</span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span class="hs-comment">-- | @ghc-boot@'s 'Module', serialized to the database.</span><span>
</span><span id="line-269"></span><span class="hs-keyword">data</span><span> </span><span id="DbModule"><span class="annot"><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier hs-var">DbModule</span></a></span></span><span>
</span><span id="line-270"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="DbModule"><span class="annot"><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier hs-var">DbModule</span></a></span></span><span>
</span><span id="line-271"></span><span>      </span><span class="hs-special">{</span><span> </span><span id="dbModuleUnitId"><span class="annot"><span class="annottext">DbModule -&gt; DbInstUnitId
</span><a href="GHC.Unit.Database.html#dbModuleUnitId"><span class="hs-identifier hs-var hs-var">dbModuleUnitId</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbInstUnitId"><span class="hs-identifier hs-type">DbInstUnitId</span></a></span><span>
</span><span id="line-272"></span><span>      </span><span class="hs-special">,</span><span> </span><span id="dbModuleName"><span class="annot"><span class="annottext">DbModule -&gt; ByteString
</span><a href="GHC.Unit.Database.html#dbModuleName"><span class="hs-identifier hs-var hs-var">dbModuleName</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span>
</span><span id="line-273"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-274"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="DbModuleVar"><span class="annot"><a href="GHC.Unit.Database.html#DbModuleVar"><span class="hs-identifier hs-var">DbModuleVar</span></a></span></span><span>
</span><span id="line-275"></span><span>      </span><span class="hs-special">{</span><span> </span><span id="dbModuleVarName"><span class="annot"><span class="annottext">DbModule -&gt; ByteString
</span><a href="GHC.Unit.Database.html#dbModuleVarName"><span class="hs-identifier hs-var hs-var">dbModuleVarName</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span>
</span><span id="line-276"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-277"></span><span>   </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679060393"><span id="local-6989586621679060398"><span class="annot"><span class="annottext">DbModule -&gt; DbModule -&gt; Bool
(DbModule -&gt; DbModule -&gt; Bool)
-&gt; (DbModule -&gt; DbModule -&gt; Bool) -&gt; Eq DbModule
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: DbModule -&gt; DbModule -&gt; Bool
$c/= :: DbModule -&gt; DbModule -&gt; Bool
== :: DbModule -&gt; DbModule -&gt; Bool
$c== :: DbModule -&gt; DbModule -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679060381"><span id="local-6989586621679060383"><span id="local-6989586621679060391"><span class="annot"><span class="annottext">Int -&gt; DbModule -&gt; ShowS
[DbModule] -&gt; ShowS
DbModule -&gt; String
(Int -&gt; DbModule -&gt; ShowS)
-&gt; (DbModule -&gt; String) -&gt; ([DbModule] -&gt; ShowS) -&gt; Show DbModule
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [DbModule] -&gt; ShowS
$cshowList :: [DbModule] -&gt; ShowS
show :: DbModule -&gt; String
$cshow :: DbModule -&gt; String
showsPrec :: Int -&gt; DbModule -&gt; ShowS
$cshowsPrec :: Int -&gt; DbModule -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-278"></span><span>
</span><span id="line-279"></span><span class="hs-comment">-- | @ghc-boot@'s instantiated unit id, serialized to the database.</span><span>
</span><span id="line-280"></span><span class="hs-keyword">data</span><span> </span><span id="DbInstUnitId"><span class="annot"><a href="GHC.Unit.Database.html#DbInstUnitId"><span class="hs-identifier hs-var">DbInstUnitId</span></a></span></span><span>
</span><span id="line-281"></span><span>
</span><span id="line-282"></span><span>   </span><span class="hs-comment">-- | Instantiated unit</span><span>
</span><span id="line-283"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span id="DbInstUnitId"><span class="annot"><a href="GHC.Unit.Database.html#DbInstUnitId"><span class="hs-identifier hs-var">DbInstUnitId</span></a></span></span><span>
</span><span id="line-284"></span><span>      </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span>               </span><span class="hs-comment">-- component id</span><span>
</span><span id="line-285"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier hs-type">DbModule</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- instantiations: [(modulename,module)]</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span>   </span><span class="hs-comment">-- | Uninstantiated unit</span><span>
</span><span id="line-288"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span id="DbUnitId"><span class="annot"><a href="GHC.Unit.Database.html#DbUnitId"><span class="hs-identifier hs-var">DbUnitId</span></a></span></span><span>
</span><span id="line-289"></span><span>      </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span>               </span><span class="hs-comment">-- unit id</span><span>
</span><span id="line-290"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679060371"><span id="local-6989586621679060377"><span class="annot"><span class="annottext">DbInstUnitId -&gt; DbInstUnitId -&gt; Bool
(DbInstUnitId -&gt; DbInstUnitId -&gt; Bool)
-&gt; (DbInstUnitId -&gt; DbInstUnitId -&gt; Bool) -&gt; Eq DbInstUnitId
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: DbInstUnitId -&gt; DbInstUnitId -&gt; Bool
$c/= :: DbInstUnitId -&gt; DbInstUnitId -&gt; Bool
== :: DbInstUnitId -&gt; DbInstUnitId -&gt; Bool
$c== :: DbInstUnitId -&gt; DbInstUnitId -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679060358"><span id="local-6989586621679060360"><span id="local-6989586621679060368"><span class="annot"><span class="annottext">Int -&gt; DbInstUnitId -&gt; ShowS
[DbInstUnitId] -&gt; ShowS
DbInstUnitId -&gt; String
(Int -&gt; DbInstUnitId -&gt; ShowS)
-&gt; (DbInstUnitId -&gt; String)
-&gt; ([DbInstUnitId] -&gt; ShowS)
-&gt; Show DbInstUnitId
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [DbInstUnitId] -&gt; ShowS
$cshowList :: [DbInstUnitId] -&gt; ShowS
show :: DbInstUnitId -&gt; String
$cshow :: DbInstUnitId -&gt; String
showsPrec :: Int -&gt; DbInstUnitId -&gt; ShowS
$cshowsPrec :: Int -&gt; DbInstUnitId -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-291"></span><span>
</span><span id="line-292"></span><span class="hs-comment">-- | Represents a lock of a package db.</span><span>
</span><span id="line-293"></span><span class="hs-keyword">newtype</span><span> </span><span id="PackageDbLock"><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-var">PackageDbLock</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PackageDbLock"><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-var">PackageDbLock</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span class="hs-comment">-- | Acquire an exclusive lock related to package DB under given location.</span><span>
</span><span id="line-296"></span><span class="annot"><a href="GHC.Unit.Database.html#lockPackageDb"><span class="hs-identifier hs-type">lockPackageDb</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-type">PackageDbLock</span></a></span><span>
</span><span id="line-297"></span><span>
</span><span id="line-298"></span><span class="hs-comment">-- | Release the lock related to package DB.</span><span>
</span><span id="line-299"></span><span class="annot"><a href="GHC.Unit.Database.html#unlockPackageDb"><span class="hs-identifier hs-type">unlockPackageDb</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-type">PackageDbLock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>
</span><span id="line-301"></span><span class="hs-comment">-- | Acquire a lock of given type related to package DB under given location.</span><span>
</span><span id="line-302"></span><span class="annot"><a href="GHC.Unit.Database.html#lockPackageDbWith"><span class="hs-identifier hs-type">lockPackageDbWith</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Lock.Common.html#LockMode"><span class="hs-identifier hs-type">LockMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-type">PackageDbLock</span></a></span><span>
</span><span id="line-303"></span><span id="lockPackageDbWith"><span class="annot"><span class="annottext">lockPackageDbWith :: LockMode -&gt; String -&gt; IO PackageDbLock
</span><a href="GHC.Unit.Database.html#lockPackageDbWith"><span class="hs-identifier hs-var hs-var">lockPackageDbWith</span></a></span></span><span> </span><span id="local-6989586621679060354"><span class="annot"><span class="annottext">LockMode
</span><a href="#local-6989586621679060354"><span class="hs-identifier hs-var">mode</span></a></span></span><span> </span><span id="local-6989586621679060353"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060353"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-304"></span><span>  </span><span class="hs-comment">-- We are trying to open the lock file and then lock it. Thus the lock file</span><span>
</span><span id="line-305"></span><span>  </span><span class="hs-comment">-- needs to either exist or we need to be able to create it. Ideally we</span><span>
</span><span id="line-306"></span><span>  </span><span class="hs-comment">-- would not assume that the lock file always exists in advance. When we are</span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-comment">-- dealing with a package DB where we have write access then if the lock</span><span>
</span><span id="line-308"></span><span>  </span><span class="hs-comment">-- file does not exist then we can create it by opening the file in</span><span>
</span><span id="line-309"></span><span>  </span><span class="hs-comment">-- read/write mode. On the other hand if we are dealing with a package DB</span><span>
</span><span id="line-310"></span><span>  </span><span class="hs-comment">-- where we do not have write access (e.g. a global DB) then we can only</span><span>
</span><span id="line-311"></span><span>  </span><span class="hs-comment">-- open in read mode, and the lock file had better exist already or we're in</span><span>
</span><span id="line-312"></span><span>  </span><span class="hs-comment">-- trouble. So for global read-only DBs on platforms where we must lock the</span><span>
</span><span id="line-313"></span><span>  </span><span class="hs-comment">-- DB for reading then we will require that the installer/packaging has</span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-comment">-- included the lock file.</span><span>
</span><span id="line-315"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-316"></span><span>  </span><span class="hs-comment">-- Thus the logic here is to first try opening in read-write mode</span><span>
</span><span id="line-317"></span><span>  </span><span class="hs-comment">-- and if that fails we try read-only (to handle global read-only DBs).</span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-comment">-- If either succeed then lock the file. IO exceptions (other than the first</span><span>
</span><span id="line-319"></span><span>  </span><span class="hs-comment">-- open attempt failing due to the file not existing) simply propagate.</span><span>
</span><span id="line-320"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-321"></span><span>  </span><span class="hs-comment">-- Note that there is a complexity here which was discovered in #13945: some</span><span>
</span><span id="line-322"></span><span>  </span><span class="hs-comment">-- filesystems (e.g. NFS) will only allow exclusive locking if the fd was</span><span>
</span><span id="line-323"></span><span>  </span><span class="hs-comment">-- opened for write access. We would previously try opening the lockfile for</span><span>
</span><span id="line-324"></span><span>  </span><span class="hs-comment">-- read-only access first, however this failed when run on such filesystems.</span><span>
</span><span id="line-325"></span><span>  </span><span class="hs-comment">-- Consequently, we now try read-write access first, falling back to read-only</span><span>
</span><span id="line-326"></span><span>  </span><span class="hs-comment">-- if we are denied permission (e.g. in the case of a global database).</span><span>
</span><span id="line-327"></span><span>  </span><span class="annot"><span class="annottext">(IOError -&gt; Maybe ())
-&gt; IO PackageDbLock -&gt; (() -&gt; IO PackageDbLock) -&gt; IO PackageDbLock
forall e b a.
Exception e =&gt;
(e -&gt; Maybe b) -&gt; IO a -&gt; (b -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/Control.Exception.Base.html#catchJust"><span class="hs-identifier hs-var">catchJust</span></a></span><span>
</span><span id="line-328"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679060351"><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621679060351"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">IOError -&gt; Bool
</span><a href="../../base/src/System.IO.Error.html#isPermissionError"><span class="hs-identifier hs-var">isPermissionError</span></a></span><span> </span><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621679060351"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; Maybe ()
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Maybe ()
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IOMode -&gt; IO PackageDbLock
</span><a href="#local-6989586621679060349"><span class="hs-identifier hs-var">lockFileOpenIn</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#ReadWriteMode"><span class="hs-identifier hs-var">ReadWriteMode</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO PackageDbLock -&gt; () -&gt; IO PackageDbLock
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">(IO PackageDbLock -&gt; () -&gt; IO PackageDbLock)
-&gt; IO PackageDbLock -&gt; () -&gt; IO PackageDbLock
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode -&gt; IO PackageDbLock
</span><a href="#local-6989586621679060349"><span class="hs-identifier hs-var">lockFileOpenIn</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#ReadMode"><span class="hs-identifier hs-var">ReadMode</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-331"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-332"></span><span>    </span><span id="local-6989586621679060345"><span class="annot"><span class="annottext">lock :: String
</span><a href="#local-6989586621679060345"><span class="hs-identifier hs-var hs-var">lock</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060353"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lock&quot;</span></span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span>    </span><span id="local-6989586621679060349"><span class="annot"><span class="annottext">lockFileOpenIn :: IOMode -&gt; IO PackageDbLock
</span><a href="#local-6989586621679060349"><span class="hs-identifier hs-var hs-var">lockFileOpenIn</span></a></span></span><span> </span><span id="local-6989586621679060343"><span class="annot"><span class="annottext">IOMode
</span><a href="#local-6989586621679060343"><span class="hs-identifier hs-var">io_mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO Handle
-&gt; (Handle -&gt; IO ())
-&gt; (Handle -&gt; IO PackageDbLock)
-&gt; IO PackageDbLock
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracketOnError"><span class="hs-identifier hs-var">bracketOnError</span></a></span><span>
</span><span id="line-335"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IOMode -&gt; IO Handle
</span><a href="../../base/src/GHC.IO.StdHandles.html#openBinaryFile"><span class="hs-identifier hs-var">openBinaryFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060345"><span class="hs-identifier hs-var">lock</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="#local-6989586621679060343"><span class="hs-identifier hs-var">io_mode</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span>      </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span>
</span><span id="line-337"></span><span>      </span><span class="hs-comment">-- If file locking support is not available, ignore the error and proceed</span><span>
</span><span id="line-338"></span><span>      </span><span class="hs-comment">-- normally. Without it the only thing we lose on non-Windows platforms is</span><span>
</span><span id="line-339"></span><span>      </span><span class="hs-comment">-- the ability to safely issue concurrent updates to the same package db.</span><span>
</span><span id="line-340"></span><span>      </span><span class="annot"><span class="annottext">((Handle -&gt; IO PackageDbLock) -&gt; IO PackageDbLock)
-&gt; (Handle -&gt; IO PackageDbLock) -&gt; IO PackageDbLock
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679060339"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060339"><span class="hs-identifier hs-var">hnd</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; LockMode -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Lock.html#hLock"><span class="hs-identifier hs-var">hLock</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060339"><span class="hs-identifier hs-var">hnd</span></a></span><span> </span><span class="annot"><span class="annottext">LockMode
</span><a href="#local-6989586621679060354"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; (FileLockingNotSupported -&gt; IO ()) -&gt; IO ()
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">FileLockingNotSupported
</span><a href="../../base/src/GHC.IO.Handle.Lock.Common.html#FileLockingNotSupported"><span class="hs-identifier hs-var">FileLockingNotSupported</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span>                   </span><span class="annot"><span class="annottext">PackageDbLock -&gt; IO PackageDbLock
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(PackageDbLock -&gt; IO PackageDbLock)
-&gt; PackageDbLock -&gt; IO PackageDbLock
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Handle -&gt; PackageDbLock
</span><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-var">PackageDbLock</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060339"><span class="hs-identifier hs-var">hnd</span></a></span><span>
</span><span id="line-342"></span><span>
</span><span id="line-343"></span><span id="lockPackageDb"><span class="annot"><span class="annottext">lockPackageDb :: String -&gt; IO PackageDbLock
</span><a href="GHC.Unit.Database.html#lockPackageDb"><span class="hs-identifier hs-var hs-var">lockPackageDb</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LockMode -&gt; String -&gt; IO PackageDbLock
</span><a href="GHC.Unit.Database.html#lockPackageDbWith"><span class="hs-identifier hs-var">lockPackageDbWith</span></a></span><span> </span><span class="annot"><span class="annottext">LockMode
</span><a href="../../base/src/GHC.IO.Handle.Lock.Common.html#ExclusiveLock"><span class="hs-identifier hs-var">ExclusiveLock</span></a></span><span>
</span><span id="line-344"></span><span id="unlockPackageDb"><span class="annot"><span class="annottext">unlockPackageDb :: PackageDbLock -&gt; IO ()
</span><a href="GHC.Unit.Database.html#unlockPackageDb"><span class="hs-identifier hs-var hs-var">unlockPackageDb</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-type">PackageDbLock</span></a></span><span> </span><span id="local-6989586621679060334"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060334"><span class="hs-identifier hs-var">hnd</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-345"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Lock.html#hUnlock"><span class="hs-identifier hs-var">hUnlock</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060334"><span class="hs-identifier hs-var">hnd</span></a></span><span>
</span><span id="line-346"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060334"><span class="hs-identifier hs-var">hnd</span></a></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-comment">-- | Mode to open a package db in.</span><span>
</span><span id="line-349"></span><span class="hs-keyword">data</span><span> </span><span id="DbMode"><span class="annot"><a href="GHC.Unit.Database.html#DbMode"><span class="hs-identifier hs-var">DbMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="DbReadOnly"><span class="annot"><a href="GHC.Unit.Database.html#DbReadOnly"><span class="hs-identifier hs-var">DbReadOnly</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="DbReadWrite"><span class="annot"><a href="GHC.Unit.Database.html#DbReadWrite"><span class="hs-identifier hs-var">DbReadWrite</span></a></span></span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span class="hs-comment">-- | 'DbOpenMode' holds a value of type @t@ but only in 'DbReadWrite' mode.  So</span><span>
</span><span id="line-352"></span><span class="hs-comment">-- it is like 'Maybe' but with a type argument for the mode to enforce that the</span><span>
</span><span id="line-353"></span><span class="hs-comment">-- mode is used consistently.</span><span>
</span><span id="line-354"></span><span class="hs-keyword">data</span><span> </span><span id="DbOpenMode"><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-var">DbOpenMode</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679060332"><span class="annot"><a href="#local-6989586621679060332"><span class="hs-identifier hs-type">mode</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbMode"><span class="hs-identifier hs-type">DbMode</span></a></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679060331"><span class="annot"><a href="#local-6989586621679060331"><span class="hs-identifier hs-type">t</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-355"></span><span>  </span><span id="local-6989586621679060791"><span id="DbOpenReadOnly"><span class="annot"><a href="GHC.Unit.Database.html#DbOpenReadOnly"><span class="hs-identifier hs-var">DbOpenReadOnly</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span>      </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="GHC.Unit.Database.html#DbReadOnly"><span class="hs-identifier hs-type">DbReadOnly</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060791"><span class="hs-identifier hs-type">t</span></a></span></span><span>
</span><span id="line-356"></span><span>  </span><span id="local-6989586621679060764"><span id="DbOpenReadWrite"><span class="annot"><a href="GHC.Unit.Database.html#DbOpenReadWrite"><span class="hs-identifier hs-var">DbOpenReadWrite</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679060764"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="hs-special">'</span><span class="annot"><a href="GHC.Unit.Database.html#DbReadWrite"><span class="hs-identifier hs-type">DbReadWrite</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060764"><span class="hs-identifier hs-type">t</span></a></span></span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span id="local-6989586621679060325"><span id="local-6989586621679060327"><span id="local-6989586621679060826"><span class="hs-keyword">deriving</span><span> </span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060826"><span class="hs-identifier hs-type">mode</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-359"></span><span id="local-6989586621679060289"><span id="local-6989586621679060291"><span id="local-6989586621679060293"><span id="local-6989586621679060295"><span id="local-6989586621679060297"><span id="local-6989586621679060299"><span id="local-6989586621679060301"><span id="local-6989586621679060303"><span id="local-6989586621679060305"><span id="local-6989586621679060307"><span id="local-6989586621679060309"><span id="local-6989586621679060311"><span id="local-6989586621679060313"><span id="local-6989586621679060315"><span id="local-6989586621679060317"><span id="local-6989586621679060319"><span id="local-6989586621679060321"><span id="local-6989586621679060810"><span class="hs-keyword">deriving</span><span> </span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">F.Foldable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060810"><span class="hs-identifier hs-type">mode</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span>
</span><span id="line-360"></span><span id="local-6989586621679060276"><span id="local-6989586621679060278"><span id="local-6989586621679060280"><span id="local-6989586621679060282"><span id="local-6989586621679060797"><span class="hs-keyword">deriving</span><span> </span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">F.Traversable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060797"><span class="hs-identifier hs-type">mode</span></a></span><span class="hs-special">)</span></span></span></span></span></span><span>
</span><span id="line-361"></span><span>
</span><span id="line-362"></span><span id="local-6989586621679060272"><span id="local-6989586621679060273"><span class="annot"><a href="GHC.Unit.Database.html#isDbOpenReadMode"><span class="hs-identifier hs-type">isDbOpenReadMode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060273"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060272"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span></span><span>
</span><span id="line-363"></span><span id="isDbOpenReadMode"><span class="annot"><span class="annottext">isDbOpenReadMode :: forall (mode :: DbMode) a. DbOpenMode mode a -&gt; Bool
</span><a href="GHC.Unit.Database.html#isDbOpenReadMode"><span class="hs-identifier hs-var hs-var">isDbOpenReadMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-364"></span><span>  </span><span class="annot"><span class="annottext">DbOpenMode mode t
</span><a href="GHC.Unit.Database.html#DbOpenReadOnly"><span class="hs-identifier hs-var">DbOpenReadOnly</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-365"></span><span>  </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenReadWrite"><span class="hs-identifier hs-type">DbOpenReadWrite</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span class="hs-comment">-- | Read the part of the package DB that GHC is interested in.</span><span>
</span><span id="line-368"></span><span class="hs-comment">--</span><span>
</span><span id="line-369"></span><span class="annot"><a href="GHC.Unit.Database.html#readPackageDbForGhc"><span class="hs-identifier hs-type">readPackageDbForGhc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Database.html#DbUnitInfo"><span class="hs-identifier hs-type">DbUnitInfo</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-370"></span><span id="readPackageDbForGhc"><span class="annot"><span class="annottext">readPackageDbForGhc :: String -&gt; IO [DbUnitInfo]
</span><a href="GHC.Unit.Database.html#readPackageDbForGhc"><span class="hs-identifier hs-var hs-var">readPackageDbForGhc</span></a></span></span><span> </span><span id="local-6989586621679060269"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060269"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-371"></span><span>  </span><span class="annot"><span class="annottext">String
-&gt; DbOpenMode 'DbReadOnly Any
-&gt; Get [DbUnitInfo]
-&gt; IO ([DbUnitInfo], DbOpenMode 'DbReadOnly PackageDbLock)
forall (mode :: DbMode) t pkgs.
String
-&gt; DbOpenMode mode t
-&gt; Get pkgs
-&gt; IO (pkgs, DbOpenMode mode PackageDbLock)
</span><a href="GHC.Unit.Database.html#decodeFromFile"><span class="hs-identifier hs-var">decodeFromFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060269"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">DbOpenMode 'DbReadOnly Any
forall t. DbOpenMode 'DbReadOnly t
</span><a href="GHC.Unit.Database.html#DbOpenReadOnly"><span class="hs-identifier hs-var">DbOpenReadOnly</span></a></span><span> </span><span class="annot"><span class="annottext">Get [DbUnitInfo]
</span><a href="#local-6989586621679060267"><span class="hs-identifier hs-var">getDbForGhc</span></a></span><span> </span><span class="annot"><span class="annottext">IO ([DbUnitInfo], DbOpenMode 'DbReadOnly PackageDbLock)
-&gt; (([DbUnitInfo], DbOpenMode 'DbReadOnly PackageDbLock)
    -&gt; IO [DbUnitInfo])
-&gt; IO [DbUnitInfo]
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-glyph">case</span><span>
</span><span id="line-372"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679060266"><span class="annot"><span class="annottext">[DbUnitInfo]
</span><a href="#local-6989586621679060266"><span class="hs-identifier hs-var">pkgs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DbOpenMode 'DbReadOnly PackageDbLock
</span><a href="GHC.Unit.Database.html#DbOpenReadOnly"><span class="hs-identifier hs-var">DbOpenReadOnly</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[DbUnitInfo] -&gt; IO [DbUnitInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[DbUnitInfo]
</span><a href="#local-6989586621679060266"><span class="hs-identifier hs-var">pkgs</span></a></span><span>
</span><span id="line-373"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-374"></span><span>    </span><span id="local-6989586621679060267"><span class="annot"><span class="annottext">getDbForGhc :: Get [DbUnitInfo]
</span><a href="#local-6989586621679060267"><span class="hs-identifier hs-var hs-var">getDbForGhc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-375"></span><span>      </span><span id="local-6989586621679060255"><span class="annot"><span class="annottext">(Word32, Word32)
</span><a href="#local-6989586621679060255"><span class="hs-identifier hs-var">_version</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get (Word32, Word32)
</span><a href="GHC.Unit.Database.html#getHeader"><span class="hs-identifier hs-var">getHeader</span></a></span><span>
</span><span id="line-376"></span><span>      </span><span id="local-6989586621679060253"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060253"><span class="hs-identifier hs-var">_ghcPartLen</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Word32
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-377"></span><span>      </span><span id="local-6989586621679060251"><span class="annot"><span class="annottext">[DbUnitInfo]
</span><a href="#local-6989586621679060251"><span class="hs-identifier hs-var">ghcPart</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [DbUnitInfo]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-378"></span><span>      </span><span class="hs-comment">-- the next part is for ghc-pkg, but we stop here.</span><span>
</span><span id="line-379"></span><span>      </span><span class="annot"><span class="annottext">[DbUnitInfo] -&gt; Get [DbUnitInfo]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">[DbUnitInfo]
</span><a href="#local-6989586621679060251"><span class="hs-identifier hs-var">ghcPart</span></a></span><span>
</span><span id="line-380"></span><span>
</span><span id="line-381"></span><span class="hs-comment">-- | Read the part of the package DB that ghc-pkg is interested in</span><span>
</span><span id="line-382"></span><span class="hs-comment">--</span><span>
</span><span id="line-383"></span><span class="hs-comment">-- Note that the Binary instance for ghc-pkg's representation of packages</span><span>
</span><span id="line-384"></span><span class="hs-comment">-- is not defined in this package. This is because ghc-pkg uses Cabal types</span><span>
</span><span id="line-385"></span><span class="hs-comment">-- (and Binary instances for these) which this package does not depend on.</span><span>
</span><span id="line-386"></span><span class="hs-comment">--</span><span>
</span><span id="line-387"></span><span class="hs-comment">-- If we open the package db in read only mode, we get its contents. Otherwise</span><span>
</span><span id="line-388"></span><span class="hs-comment">-- we additionally receive a PackageDbLock that represents a lock on the</span><span>
</span><span id="line-389"></span><span class="hs-comment">-- database, so that we can safely update it later.</span><span>
</span><span id="line-390"></span><span class="hs-comment">--</span><span>
</span><span id="line-391"></span><span id="local-6989586621679060784"><span id="local-6989586621679060785"><span id="local-6989586621679060786"><span class="annot"><a href="GHC.Unit.Database.html#readPackageDbForGhcPkg"><span class="hs-identifier hs-type">readPackageDbForGhcPkg</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060786"><span class="hs-identifier hs-type">pkgs</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060785"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060784"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-392"></span><span>                          </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060786"><span class="hs-identifier hs-type">pkgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060785"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-type">PackageDbLock</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-393"></span><span id="readPackageDbForGhcPkg"><span class="annot"><span class="annottext">readPackageDbForGhcPkg :: forall pkgs (mode :: DbMode) t.
Binary pkgs =&gt;
String
-&gt; DbOpenMode mode t -&gt; IO (pkgs, DbOpenMode mode PackageDbLock)
</span><a href="GHC.Unit.Database.html#readPackageDbForGhcPkg"><span class="hs-identifier hs-var hs-var">readPackageDbForGhcPkg</span></a></span></span><span> </span><span id="local-6989586621679060249"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060249"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span id="local-6989586621679060248"><span class="annot"><span class="annottext">DbOpenMode mode t
</span><a href="#local-6989586621679060248"><span class="hs-identifier hs-var">mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-394"></span><span>    </span><span class="annot"><span class="annottext">String
-&gt; DbOpenMode mode t
-&gt; Get pkgs
-&gt; IO (pkgs, DbOpenMode mode PackageDbLock)
forall (mode :: DbMode) t pkgs.
String
-&gt; DbOpenMode mode t
-&gt; Get pkgs
-&gt; IO (pkgs, DbOpenMode mode PackageDbLock)
</span><a href="GHC.Unit.Database.html#decodeFromFile"><span class="hs-identifier hs-var">decodeFromFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060249"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">DbOpenMode mode t
</span><a href="#local-6989586621679060248"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Get pkgs
</span><a href="#local-6989586621679060247"><span class="hs-identifier hs-var">getDbForGhcPkg</span></a></span><span>
</span><span id="line-395"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-396"></span><span>    </span><span id="local-6989586621679060247"><span class="annot"><span class="annottext">getDbForGhcPkg :: Get pkgs
</span><a href="#local-6989586621679060247"><span class="hs-identifier hs-var hs-var">getDbForGhcPkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-397"></span><span>      </span><span id="local-6989586621679060237"><span class="annot"><span class="annottext">(Word32, Word32)
</span><a href="#local-6989586621679060237"><span class="hs-identifier hs-var">_version</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get (Word32, Word32)
</span><a href="GHC.Unit.Database.html#getHeader"><span class="hs-identifier hs-var">getHeader</span></a></span><span>
</span><span id="line-398"></span><span>      </span><span class="hs-comment">-- skip over the ghc part</span><span>
</span><span id="line-399"></span><span>      </span><span id="local-6989586621679060236"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060236"><span class="hs-identifier hs-var">ghcPartLen</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Word32
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-400"></span><span>      </span><span id="local-6989586621679060235"><span class="annot"><span class="annottext">()
</span><a href="#local-6989586621679060235"><span class="hs-identifier hs-var">_ghcPart</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ()
</span><a href="../../binary/src/Data.Binary.Get.html#skip"><span class="hs-identifier hs-var">skip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060236"><span class="hs-identifier hs-var">ghcPartLen</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-401"></span><span>      </span><span class="hs-comment">-- the next part is for ghc-pkg</span><span>
</span><span id="line-402"></span><span>      </span><span id="local-6989586621679060233"><span class="annot"><span class="annottext">pkgs
</span><a href="#local-6989586621679060233"><span class="hs-identifier hs-var">ghcPkgPart</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get pkgs
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-403"></span><span>      </span><span class="annot"><span class="annottext">pkgs -&gt; Get pkgs
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">pkgs
</span><a href="#local-6989586621679060233"><span class="hs-identifier hs-var">ghcPkgPart</span></a></span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="hs-comment">-- | Write the whole of the package DB, both parts.</span><span>
</span><span id="line-406"></span><span class="hs-comment">--</span><span>
</span><span id="line-407"></span><span id="local-6989586621679060778"><span class="annot"><a href="GHC.Unit.Database.html#writePackageDb"><span class="hs-identifier hs-type">writePackageDb</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060778"><span class="hs-identifier hs-type">pkgs</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.Database.html#DbUnitInfo"><span class="hs-identifier hs-type">DbUnitInfo</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679060778"><span class="hs-identifier hs-type">pkgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-408"></span><span id="writePackageDb"><span class="annot"><span class="annottext">writePackageDb :: forall pkgs. Binary pkgs =&gt; String -&gt; [DbUnitInfo] -&gt; pkgs -&gt; IO ()
</span><a href="GHC.Unit.Database.html#writePackageDb"><span class="hs-identifier hs-var hs-var">writePackageDb</span></a></span></span><span> </span><span id="local-6989586621679060221"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060221"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span id="local-6989586621679060220"><span class="annot"><span class="annottext">[DbUnitInfo]
</span><a href="#local-6989586621679060220"><span class="hs-identifier hs-var">ghcPkgs</span></a></span></span><span> </span><span id="local-6989586621679060219"><span class="annot"><span class="annottext">pkgs
</span><a href="#local-6989586621679060219"><span class="hs-identifier hs-var">ghcPkgPart</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-409"></span><span>  </span><span class="annot"><span class="annottext">String -&gt; ByteString -&gt; IO ()
</span><a href="GHC.Unit.Database.html#writeFileAtomic"><span class="hs-identifier hs-var">writeFileAtomic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060221"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Put -&gt; ByteString
</span><a href="../../binary/src/Data.Binary.Put.html#runPut"><span class="hs-identifier hs-var">runPut</span></a></span><span> </span><span class="annot"><span class="annottext">Put
</span><a href="#local-6989586621679060216"><span class="hs-identifier hs-var">putDbForGhcPkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-410"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-411"></span><span>    </span><span id="local-6989586621679060216"><span class="annot"><span class="annottext">putDbForGhcPkg :: Put
</span><a href="#local-6989586621679060216"><span class="hs-identifier hs-var hs-var">putDbForGhcPkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-412"></span><span>        </span><span class="annot"><span class="annottext">Put
</span><a href="GHC.Unit.Database.html#putHeader"><span class="hs-identifier hs-var">putHeader</span></a></span><span>
</span><span id="line-413"></span><span>        </span><span class="annot"><span class="annottext">Word32 -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span>               </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060213"><span class="hs-identifier hs-var">ghcPartLen</span></a></span><span>
</span><span id="line-414"></span><span>        </span><span class="annot"><span class="annottext">ByteString -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putLazyByteString"><span class="hs-identifier hs-var">putLazyByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060211"><span class="hs-identifier hs-var">ghcPart</span></a></span><span>
</span><span id="line-415"></span><span>        </span><span class="annot"><span class="annottext">pkgs -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span>               </span><span class="annot"><span class="annottext">pkgs
</span><a href="#local-6989586621679060219"><span class="hs-identifier hs-var">ghcPkgPart</span></a></span><span>
</span><span id="line-416"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-417"></span><span>        </span><span class="annot"><a href="#local-6989586621679060213"><span class="hs-identifier hs-type">ghcPartLen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-418"></span><span>        </span><span id="local-6989586621679060213"><span class="annot"><span class="annottext">ghcPartLen :: Word32
</span><a href="#local-6989586621679060213"><span class="hs-identifier hs-var hs-var">ghcPartLen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int64 -&gt; Word32
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Int64
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#length"><span class="hs-identifier hs-var">BS.Lazy.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060211"><span class="hs-identifier hs-var">ghcPart</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>        </span><span id="local-6989586621679060211"><span class="annot"><span class="annottext">ghcPart :: ByteString
</span><a href="#local-6989586621679060211"><span class="hs-identifier hs-var hs-var">ghcPart</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[DbUnitInfo] -&gt; ByteString
forall a. Binary a =&gt; a -&gt; ByteString
</span><a href="../../binary/src/Data.Binary.html#encode"><span class="hs-identifier hs-var">encode</span></a></span><span> </span><span class="annot"><span class="annottext">[DbUnitInfo]
</span><a href="#local-6989586621679060220"><span class="hs-identifier hs-var">ghcPkgs</span></a></span><span>
</span><span id="line-420"></span><span>
</span><span id="line-421"></span><span class="annot"><a href="GHC.Unit.Database.html#getHeader"><span class="hs-identifier hs-type">getHeader</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span id="getHeader"><span class="annot"><span class="annottext">getHeader :: Get (Word32, Word32)
</span><a href="GHC.Unit.Database.html#getHeader"><span class="hs-identifier hs-var hs-var">getHeader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-423"></span><span>    </span><span id="local-6989586621679060208"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060208"><span class="hs-identifier hs-var">magic</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Get ByteString
</span><a href="../../binary/src/Data.Binary.Get.Internal.html#getByteString"><span class="hs-identifier hs-var">getByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">BS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="GHC.Unit.Database.html#headerMagic"><span class="hs-identifier hs-var">headerMagic</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Get () -&gt; Get ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060208"><span class="hs-identifier hs-var">magic</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="GHC.Unit.Database.html#headerMagic"><span class="hs-identifier hs-var">headerMagic</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Get () -&gt; Get ()) -&gt; Get () -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-425"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; Get ()
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not a ghc-pkg db file, wrong file magic number&quot;</span></span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span>    </span><span id="local-6989586621679060203"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060203"><span class="hs-identifier hs-var">majorVersion</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Word32
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-428"></span><span>    </span><span class="hs-comment">-- The major version is for incompatible changes</span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span>    </span><span id="local-6989586621679060202"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060202"><span class="hs-identifier hs-var">minorVersion</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Word32
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-431"></span><span>    </span><span class="hs-comment">-- The minor version is for compatible extensions</span><span>
</span><span id="line-432"></span><span>
</span><span id="line-433"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Get () -&gt; Get ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060203"><span class="hs-identifier hs-var">majorVersion</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Get () -&gt; Get ()) -&gt; Get () -&gt; Get ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-434"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; Get ()
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;unsupported ghc-pkg db format version&quot;</span></span><span>
</span><span id="line-435"></span><span>    </span><span class="hs-comment">-- If we ever support multiple major versions then we'll have to change</span><span>
</span><span id="line-436"></span><span>    </span><span class="hs-comment">-- this code</span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span>    </span><span class="hs-comment">-- The header can be extended without incrementing the major version,</span><span>
</span><span id="line-439"></span><span>    </span><span class="hs-comment">-- we ignore fields we don't know about (currently all).</span><span>
</span><span id="line-440"></span><span>    </span><span id="local-6989586621679060201"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060201"><span class="hs-identifier hs-var">headerExtraLen</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Word32
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-441"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Get ()
</span><a href="../../binary/src/Data.Binary.Get.html#skip"><span class="hs-identifier hs-var">skip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060201"><span class="hs-identifier hs-var">headerExtraLen</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span>    </span><span class="annot"><span class="annottext">(Word32, Word32) -&gt; Get (Word32, Word32)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060203"><span class="hs-identifier hs-var">majorVersion</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060202"><span class="hs-identifier hs-var">minorVersion</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="annot"><a href="GHC.Unit.Database.html#putHeader"><span class="hs-identifier hs-type">putHeader</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Put.html#Put"><span class="hs-identifier hs-type">Put</span></a></span><span>
</span><span id="line-446"></span><span id="putHeader"><span class="annot"><span class="annottext">putHeader :: Put
</span><a href="GHC.Unit.Database.html#putHeader"><span class="hs-identifier hs-var hs-var">putHeader</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-447"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putByteString"><span class="hs-identifier hs-var">putByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="GHC.Unit.Database.html#headerMagic"><span class="hs-identifier hs-var">headerMagic</span></a></span><span>
</span><span id="line-448"></span><span>    </span><span class="annot"><span class="annottext">Word32 -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060199"><span class="hs-identifier hs-var">majorVersion</span></a></span><span>
</span><span id="line-449"></span><span>    </span><span class="annot"><span class="annottext">Word32 -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060198"><span class="hs-identifier hs-var">minorVersion</span></a></span><span>
</span><span id="line-450"></span><span>    </span><span class="annot"><span class="annottext">Word32 -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679060197"><span class="hs-identifier hs-var">headerExtraLen</span></a></span><span>
</span><span id="line-451"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-452"></span><span>    </span><span id="local-6989586621679060199"><span class="annot"><span class="annottext">majorVersion :: Word32
</span><a href="#local-6989586621679060199"><span class="hs-identifier hs-var hs-var">majorVersion</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-453"></span><span>    </span><span id="local-6989586621679060198"><span class="annot"><span class="annottext">minorVersion :: Word32
</span><a href="#local-6989586621679060198"><span class="hs-identifier hs-var hs-var">minorVersion</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-454"></span><span>    </span><span id="local-6989586621679060197"><span class="annot"><span class="annottext">headerExtraLen :: Word32
</span><a href="#local-6989586621679060197"><span class="hs-identifier hs-var hs-var">headerExtraLen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-455"></span><span>
</span><span id="line-456"></span><span class="annot"><a href="GHC.Unit.Database.html#headerMagic"><span class="hs-identifier hs-type">headerMagic</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.ByteString</span></a></span><span>
</span><span id="line-457"></span><span id="headerMagic"><span class="annot"><span class="annottext">headerMagic :: ByteString
</span><a href="GHC.Unit.Database.html#headerMagic"><span class="hs-identifier hs-var hs-var">headerMagic</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">BS.Char8.pack</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\0ghcpkg\0&quot;</span></span><span>
</span><span id="line-458"></span><span>
</span><span id="line-459"></span><span>
</span><span id="line-460"></span><span class="hs-comment">-- TODO: we may be able to replace the following with utils from the binary</span><span>
</span><span id="line-461"></span><span class="hs-comment">-- package in future.</span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span class="hs-comment">-- | Feed a 'Get' decoder with data chunks from a file.</span><span>
</span><span id="line-464"></span><span class="hs-comment">--</span><span>
</span><span id="line-465"></span><span id="local-6989586621679060792"><span id="local-6989586621679060793"><span id="local-6989586621679060794"><span class="annot"><a href="GHC.Unit.Database.html#decodeFromFile"><span class="hs-identifier hs-type">decodeFromFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060794"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060793"><span class="hs-identifier hs-type">t</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../binary/src/Data.Binary.Get.Internal.html#Get"><span class="hs-identifier hs-type">Get</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060792"><span class="hs-identifier hs-type">pkgs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-466"></span><span>                  </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679060792"><span class="hs-identifier hs-type">pkgs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenMode"><span class="hs-identifier hs-type">DbOpenMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060794"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#PackageDbLock"><span class="hs-identifier hs-type">PackageDbLock</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-467"></span><span id="decodeFromFile"><span class="annot"><span class="annottext">decodeFromFile :: forall (mode :: DbMode) t pkgs.
String
-&gt; DbOpenMode mode t
-&gt; Get pkgs
-&gt; IO (pkgs, DbOpenMode mode PackageDbLock)
</span><a href="GHC.Unit.Database.html#decodeFromFile"><span class="hs-identifier hs-var hs-var">decodeFromFile</span></a></span></span><span> </span><span id="local-6989586621679060190"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060190"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span id="local-6989586621679060189"><span class="annot"><span class="annottext">DbOpenMode mode t
</span><a href="#local-6989586621679060189"><span class="hs-identifier hs-var">mode</span></a></span></span><span> </span><span id="local-6989586621679060188"><span class="annot"><span class="annottext">Get pkgs
</span><a href="#local-6989586621679060188"><span class="hs-identifier hs-var">decoder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DbOpenMode mode t
</span><a href="#local-6989586621679060189"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-468"></span><span>  </span><span class="annot"><span class="annottext">DbOpenMode mode t
</span><a href="GHC.Unit.Database.html#DbOpenReadOnly"><span class="hs-identifier hs-var">DbOpenReadOnly</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-469"></span><span>  </span><span class="hs-comment">-- Note [Locking package database on Windows]</span><span>
</span><span id="line-470"></span><span>  </span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-471"></span><span>  </span><span class="hs-comment">-- When we open the package db in read only mode, there is no need to acquire</span><span>
</span><span id="line-472"></span><span>  </span><span class="hs-comment">-- shared lock on non-Windows platform because we update the database with an</span><span>
</span><span id="line-473"></span><span>  </span><span class="hs-comment">-- atomic rename, so readers will always see the database in a consistent</span><span>
</span><span id="line-474"></span><span>  </span><span class="hs-comment">-- state.</span><span class="hs-cpp">
#if defined(mingw32_HOST_OS)
</span><span>    </span><span class="annot"><span class="annottext">IO PackageDbLock
-&gt; (PackageDbLock -&gt; IO ())
-&gt; (PackageDbLock
    -&gt; IO (pkgs, DbOpenMode 'DbReadOnly PackageDbLock))
-&gt; IO (pkgs, DbOpenMode 'DbReadOnly PackageDbLock)
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LockMode -&gt; String -&gt; IO PackageDbLock
</span><a href="GHC.Unit.Database.html#lockPackageDbWith"><span class="hs-identifier hs-var">lockPackageDbWith</span></a></span><span> </span><span class="annot"><span class="annottext">LockMode
</span><a href="../../base/src/GHC.IO.Handle.Lock.Common.html#SharedLock"><span class="hs-identifier hs-var">SharedLock</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060190"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">PackageDbLock -&gt; IO ()
</span><a href="GHC.Unit.Database.html#unlockPackageDb"><span class="hs-identifier hs-var">unlockPackageDb</span></a></span><span> </span><span class="annot"><span class="annottext">((PackageDbLock -&gt; IO (pkgs, DbOpenMode 'DbReadOnly PackageDbLock))
 -&gt; IO (pkgs, DbOpenMode 'DbReadOnly PackageDbLock))
-&gt; (PackageDbLock
    -&gt; IO (pkgs, DbOpenMode 'DbReadOnly PackageDbLock))
-&gt; IO (pkgs, DbOpenMode 'DbReadOnly PackageDbLock)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">PackageDbLock
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span class="hs-cpp">
#endif
</span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="hs-special">,</span></span><span> </span><span class="annot"><span class="annottext">DbOpenMode 'DbReadOnly PackageDbLock
forall t. DbOpenMode 'DbReadOnly t
</span><a href="GHC.Unit.Database.html#DbOpenReadOnly"><span class="hs-identifier hs-var">DbOpenReadOnly</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(pkgs -&gt; (pkgs, DbOpenMode 'DbReadOnly PackageDbLock))
-&gt; IO pkgs -&gt; IO (pkgs, DbOpenMode 'DbReadOnly PackageDbLock)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">IO pkgs
</span><a href="#local-6989586621679060181"><span class="hs-identifier hs-var">decodeFileContents</span></a></span><span>
</span><span id="line-479"></span><span>  </span><span class="annot"><a href="GHC.Unit.Database.html#DbOpenReadWrite"><span class="hs-identifier hs-type">DbOpenReadWrite</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-480"></span><span>    </span><span class="hs-comment">-- When we open the package db in read/write mode, acquire an exclusive lock</span><span>
</span><span id="line-481"></span><span>    </span><span class="hs-comment">-- on the database and return it so we can keep it for the duration of the</span><span>
</span><span id="line-482"></span><span>    </span><span class="hs-comment">-- update.</span><span>
</span><span id="line-483"></span><span>    </span><span class="annot"><span class="annottext">IO PackageDbLock
-&gt; (PackageDbLock -&gt; IO ())
-&gt; (PackageDbLock
    -&gt; IO (pkgs, DbOpenMode 'DbReadWrite PackageDbLock))
-&gt; IO (pkgs, DbOpenMode 'DbReadWrite PackageDbLock)
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracketOnError"><span class="hs-identifier hs-var">bracketOnError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IO PackageDbLock
</span><a href="GHC.Unit.Database.html#lockPackageDb"><span class="hs-identifier hs-var">lockPackageDb</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060190"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">PackageDbLock -&gt; IO ()
</span><a href="GHC.Unit.Database.html#unlockPackageDb"><span class="hs-identifier hs-var">unlockPackageDb</span></a></span><span> </span><span class="annot"><span class="annottext">((PackageDbLock
  -&gt; IO (pkgs, DbOpenMode 'DbReadWrite PackageDbLock))
 -&gt; IO (pkgs, DbOpenMode 'DbReadWrite PackageDbLock))
-&gt; (PackageDbLock
    -&gt; IO (pkgs, DbOpenMode 'DbReadWrite PackageDbLock))
-&gt; IO (pkgs, DbOpenMode 'DbReadWrite PackageDbLock)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679060178"><span class="annot"><span class="annottext">PackageDbLock
</span><a href="#local-6989586621679060178"><span class="hs-identifier hs-var">lock</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-484"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="hs-special">,</span></span><span> </span><span class="annot"><span class="annottext">PackageDbLock -&gt; DbOpenMode 'DbReadWrite PackageDbLock
forall t. t -&gt; DbOpenMode 'DbReadWrite t
</span><a href="GHC.Unit.Database.html#DbOpenReadWrite"><span class="hs-identifier hs-var">DbOpenReadWrite</span></a></span><span> </span><span class="annot"><span class="annottext">PackageDbLock
</span><a href="#local-6989586621679060178"><span class="hs-identifier hs-var">lock</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(pkgs -&gt; (pkgs, DbOpenMode 'DbReadWrite PackageDbLock))
-&gt; IO pkgs -&gt; IO (pkgs, DbOpenMode 'DbReadWrite PackageDbLock)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">IO pkgs
</span><a href="#local-6989586621679060181"><span class="hs-identifier hs-var">decodeFileContents</span></a></span><span>
</span><span id="line-485"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-486"></span><span>    </span><span id="local-6989586621679060181"><span class="annot"><span class="annottext">decodeFileContents :: IO pkgs
</span><a href="#local-6989586621679060181"><span class="hs-identifier hs-var hs-var">decodeFileContents</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IOMode -&gt; (Handle -&gt; IO pkgs) -&gt; IO pkgs
forall r. String -&gt; IOMode -&gt; (Handle -&gt; IO r) -&gt; IO r
</span><a href="../../base/src/System.IO.html#withBinaryFile"><span class="hs-identifier hs-var">withBinaryFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060190"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="annot"><span class="annottext">IOMode
</span><a href="../../base/src/GHC.IO.IOMode.html#ReadMode"><span class="hs-identifier hs-var">ReadMode</span></a></span><span> </span><span class="annot"><span class="annottext">((Handle -&gt; IO pkgs) -&gt; IO pkgs) -&gt; (Handle -&gt; IO pkgs) -&gt; IO pkgs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679060176"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060176"><span class="hs-identifier hs-var">hnd</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-487"></span><span>      </span><span class="annot"><span class="annottext">Handle -&gt; Decoder pkgs -&gt; IO pkgs
</span><a href="#local-6989586621679060175"><span class="hs-identifier hs-var">feed</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060176"><span class="hs-identifier hs-var">hnd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Get pkgs -&gt; Decoder pkgs
forall a. Get a -&gt; Decoder a
</span><a href="../../binary/src/Data.Binary.Get.html#runGetIncremental"><span class="hs-identifier hs-var">runGetIncremental</span></a></span><span> </span><span class="annot"><span class="annottext">Get pkgs
</span><a href="#local-6989586621679060188"><span class="hs-identifier hs-var">decoder</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span>
</span><span id="line-489"></span><span>    </span><span id="local-6989586621679060175"><span class="annot"><span class="annottext">feed :: Handle -&gt; Decoder pkgs -&gt; IO pkgs
</span><a href="#local-6989586621679060175"><span class="hs-identifier hs-var hs-var">feed</span></a></span></span><span> </span><span id="local-6989586621679060173"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060173"><span class="hs-identifier hs-var">hnd</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../binary/src/Data.Binary.Get.html#Partial"><span class="hs-identifier hs-type">Partial</span></a></span><span> </span><span id="local-6989586621679060171"><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder pkgs
</span><a href="#local-6989586621679060171"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679060170"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060170"><span class="hs-identifier hs-var">chunk</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; Int -&gt; IO ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#hGet"><span class="hs-identifier hs-var">BS.hGet</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060173"><span class="hs-identifier hs-var">hnd</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#defaultChunkSize"><span class="hs-identifier hs-var">BS.Lazy.defaultChunkSize</span></a></span><span>
</span><span id="line-490"></span><span>                               </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.html#null"><span class="hs-identifier hs-var">BS.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060170"><span class="hs-identifier hs-var">chunk</span></a></span><span>
</span><span id="line-491"></span><span>                                 </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; Decoder pkgs -&gt; IO pkgs
</span><a href="#local-6989586621679060175"><span class="hs-identifier hs-var">feed</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060173"><span class="hs-identifier hs-var">hnd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder pkgs
</span><a href="#local-6989586621679060171"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-492"></span><span>                                 </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; Decoder pkgs -&gt; IO pkgs
</span><a href="#local-6989586621679060175"><span class="hs-identifier hs-var">feed</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060173"><span class="hs-identifier hs-var">hnd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Decoder pkgs
</span><a href="#local-6989586621679060171"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString -&gt; Maybe ByteString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060170"><span class="hs-identifier hs-var">chunk</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-493"></span><span>    </span><span class="annot"><a href="#local-6989586621679060175"><span class="hs-identifier hs-var">feed</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../binary/src/Data.Binary.Get.html#Done"><span class="hs-identifier hs-type">Done</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679060166"><span class="annot"><span class="annottext">pkgs
</span><a href="#local-6989586621679060166"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">pkgs -&gt; IO pkgs
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">pkgs
</span><a href="#local-6989586621679060166"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-494"></span><span>    </span><span class="annot"><a href="#local-6989586621679060175"><span class="hs-identifier hs-var">feed</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../binary/src/Data.Binary.Get.html#Fail"><span class="hs-identifier hs-type">Fail</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int64
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679060164"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060164"><span class="hs-identifier hs-var">msg</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOError -&gt; IO pkgs
forall a. IOError -&gt; IO a
</span><a href="../../base/src/GHC.IO.Exception.html#ioError"><span class="hs-identifier hs-var">ioError</span></a></span><span> </span><span class="annot"><span class="annottext">IOError
</span><a href="#local-6989586621679060162"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-495"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-496"></span><span>        </span><span id="local-6989586621679060162"><span class="annot"><span class="annottext">err :: IOError
</span><a href="#local-6989586621679060162"><span class="hs-identifier hs-var hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IOErrorType -&gt; String -&gt; Maybe Handle -&gt; Maybe String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#mkIOError"><span class="hs-identifier hs-var">mkIOError</span></a></span><span> </span><span class="annot"><span class="annottext">IOErrorType
</span><a href="../../base/src/GHC.IO.Exception.html#InappropriateType"><span class="hs-identifier hs-var">InappropriateType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060160"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Handle
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060190"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-497"></span><span>              </span><span class="annot"><span class="annottext">IOError -&gt; String -&gt; IOError
</span><a href="../../base/src/System.IO.Error.html#ioeSetErrorString"><span class="hs-operator hs-var">`ioeSetErrorString`</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060164"><span class="hs-identifier hs-var">msg</span></a></span><span>
</span><span id="line-498"></span><span>        </span><span id="local-6989586621679060160"><span class="annot"><span class="annottext">loc :: String
</span><a href="#local-6989586621679060160"><span class="hs-identifier hs-var hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.Unit.Database.readPackageDb&quot;</span></span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span class="hs-comment">-- Copied from Cabal's Distribution.Simple.Utils.</span><span>
</span><span id="line-501"></span><span class="annot"><a href="GHC.Unit.Database.html#writeFileAtomic"><span class="hs-identifier hs-type">writeFileAtomic</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">BS.Lazy.ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-502"></span><span id="writeFileAtomic"><span class="annot"><span class="annottext">writeFileAtomic :: String -&gt; ByteString -&gt; IO ()
</span><a href="GHC.Unit.Database.html#writeFileAtomic"><span class="hs-identifier hs-var hs-var">writeFileAtomic</span></a></span></span><span> </span><span id="local-6989586621679060158"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060158"><span class="hs-identifier hs-var">targetPath</span></a></span></span><span> </span><span id="local-6989586621679060157"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060157"><span class="hs-identifier hs-var">content</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-503"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679060156"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060156"><span class="hs-identifier hs-var">targetDir</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679060155"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060155"><span class="hs-identifier hs-var">targetFile</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitFileName"><span class="hs-identifier hs-var">splitFileName</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060158"><span class="hs-identifier hs-var">targetPath</span></a></span><span>
</span><span id="line-504"></span><span>  </span><span class="annot"><span class="annottext">IO (String, Handle)
-&gt; ((String, Handle) -&gt; IO ())
-&gt; ((String, Handle) -&gt; IO ())
-&gt; IO ()
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="../../base/src/Control.Exception.Base.html#bracketOnError"><span class="hs-identifier hs-var">Exception.bracketOnError</span></a></span><span>
</span><span id="line-505"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO (String, Handle)
</span><a href="../../base/src/System.IO.html#openBinaryTempFileWithDefaultPermissions"><span class="hs-identifier hs-var">openBinaryTempFileWithDefaultPermissions</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060156"><span class="hs-identifier hs-var">targetDir</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; IO (String, Handle)) -&gt; String -&gt; IO (String, Handle)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060155"><span class="hs-identifier hs-var">targetFile</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tmp&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-506"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679060152"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060152"><span class="hs-identifier hs-var">tmpPath</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679060151"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060151"><span class="hs-identifier hs-var">handle</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060151"><span class="hs-identifier hs-var">handle</span></a></span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IO () -&gt; IO ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#removeFile"><span class="hs-identifier hs-var">removeFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060152"><span class="hs-identifier hs-var">tmpPath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-507"></span><span>    </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679060149"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060149"><span class="hs-identifier hs-var">tmpPath</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679060148"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060148"><span class="hs-identifier hs-var">handle</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-508"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#hPut"><span class="hs-identifier hs-var">BS.Lazy.hPut</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060148"><span class="hs-identifier hs-var">handle</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060157"><span class="hs-identifier hs-var">content</span></a></span><span>
</span><span id="line-509"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679060148"><span class="hs-identifier hs-var">handle</span></a></span><span>
</span><span id="line-510"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ()
</span><a href="../../directory/src/System.Directory.html#renameFile"><span class="hs-identifier hs-var">renameFile</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060149"><span class="hs-identifier hs-var">tmpPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060158"><span class="hs-identifier hs-var">targetPath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-511"></span><span>
</span><span id="line-512"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679060142"><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbUnitInfo"><span class="hs-identifier hs-type">DbUnitInfo</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-513"></span><span>  </span><span id="local-6989586621679060071"><span class="annot"><span class="annottext">put :: DbUnitInfo -&gt; Put
</span><a href="#local-6989586621679060071"><span class="hs-identifier hs-var hs-var hs-var hs-var">put</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span>
</span><span id="line-514"></span><span>         </span><span id="local-6989586621679060070"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060070"><span class="hs-identifier hs-var">unitId</span></a></span></span><span> </span><span id="local-6989586621679060069"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060069"><span class="hs-identifier hs-var">unitInstanceOf</span></a></span></span><span> </span><span id="local-6989586621679060068"><span class="annot"><span class="annottext">[(ByteString, DbModule)]
</span><a href="#local-6989586621679060068"><span class="hs-identifier hs-var">unitInstantiations</span></a></span></span><span>
</span><span id="line-515"></span><span>         </span><span id="local-6989586621679060067"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060067"><span class="hs-identifier hs-var">unitPackageId</span></a></span></span><span>
</span><span id="line-516"></span><span>         </span><span id="local-6989586621679060066"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060066"><span class="hs-identifier hs-var">unitPackageName</span></a></span></span><span> </span><span id="local-6989586621679060065"><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679060065"><span class="hs-identifier hs-var">unitPackageVersion</span></a></span></span><span>
</span><span id="line-517"></span><span>         </span><span id="local-6989586621679060064"><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679060064"><span class="hs-identifier hs-var">unitComponentName</span></a></span></span><span>
</span><span id="line-518"></span><span>         </span><span id="local-6989586621679060063"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060063"><span class="hs-identifier hs-var">unitAbiHash</span></a></span></span><span> </span><span id="local-6989586621679060062"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679060062"><span class="hs-identifier hs-var">unitDepends</span></a></span></span><span> </span><span id="local-6989586621679060061"><span class="annot"><span class="annottext">[(ByteString, String)]
</span><a href="#local-6989586621679060061"><span class="hs-identifier hs-var">unitAbiDepends</span></a></span></span><span> </span><span id="local-6989586621679060060"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060060"><span class="hs-identifier hs-var">unitImportDirs</span></a></span></span><span>
</span><span id="line-519"></span><span>         </span><span id="local-6989586621679060059"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060059"><span class="hs-identifier hs-var">unitLibraries</span></a></span></span><span> </span><span id="local-6989586621679060058"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060058"><span class="hs-identifier hs-var">unitExtDepLibsSys</span></a></span></span><span> </span><span id="local-6989586621679060057"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060057"><span class="hs-identifier hs-var">unitExtDepLibsGhc</span></a></span></span><span>
</span><span id="line-520"></span><span>         </span><span id="local-6989586621679060056"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060056"><span class="hs-identifier hs-var">unitLibraryDirs</span></a></span></span><span> </span><span id="local-6989586621679060055"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060055"><span class="hs-identifier hs-var">unitLibraryDynDirs</span></a></span></span><span>
</span><span id="line-521"></span><span>         </span><span id="local-6989586621679060054"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060054"><span class="hs-identifier hs-var">unitExtDepFrameworks</span></a></span></span><span> </span><span id="local-6989586621679060053"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060053"><span class="hs-identifier hs-var">unitExtDepFrameworkDirs</span></a></span></span><span>
</span><span id="line-522"></span><span>         </span><span id="local-6989586621679060052"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060052"><span class="hs-identifier hs-var">unitLinkerOptions</span></a></span></span><span> </span><span id="local-6989586621679060051"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060051"><span class="hs-identifier hs-var">unitCcOptions</span></a></span></span><span>
</span><span id="line-523"></span><span>         </span><span id="local-6989586621679060050"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060050"><span class="hs-identifier hs-var">unitIncludes</span></a></span></span><span> </span><span id="local-6989586621679060049"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060049"><span class="hs-identifier hs-var">unitIncludeDirs</span></a></span></span><span>
</span><span id="line-524"></span><span>         </span><span id="local-6989586621679060048"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060048"><span class="hs-identifier hs-var">unitHaddockInterfaces</span></a></span></span><span> </span><span id="local-6989586621679060047"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060047"><span class="hs-identifier hs-var">unitHaddockHTMLs</span></a></span></span><span>
</span><span id="line-525"></span><span>         </span><span id="local-6989586621679060046"><span class="annot"><span class="annottext">[(ByteString, Maybe DbModule)]
</span><a href="#local-6989586621679060046"><span class="hs-identifier hs-var">unitExposedModules</span></a></span></span><span> </span><span id="local-6989586621679060045"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679060045"><span class="hs-identifier hs-var">unitHiddenModules</span></a></span></span><span>
</span><span id="line-526"></span><span>         </span><span id="local-6989586621679060044"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679060044"><span class="hs-identifier hs-var">unitIsIndefinite</span></a></span></span><span> </span><span id="local-6989586621679060043"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679060043"><span class="hs-identifier hs-var">unitIsExposed</span></a></span></span><span> </span><span id="local-6989586621679060042"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679060042"><span class="hs-identifier hs-var">unitIsTrusted</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-527"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060067"><span class="hs-identifier hs-var">unitPackageId</span></a></span><span>
</span><span id="line-528"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060066"><span class="hs-identifier hs-var">unitPackageName</span></a></span><span>
</span><span id="line-529"></span><span>    </span><span class="annot"><span class="annottext">Version -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679060065"><span class="hs-identifier hs-var">unitPackageVersion</span></a></span><span>
</span><span id="line-530"></span><span>    </span><span class="annot"><span class="annottext">Maybe ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679060064"><span class="hs-identifier hs-var">unitComponentName</span></a></span><span>
</span><span id="line-531"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060070"><span class="hs-identifier hs-var">unitId</span></a></span><span>
</span><span id="line-532"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679060069"><span class="hs-identifier hs-var">unitInstanceOf</span></a></span><span>
</span><span id="line-533"></span><span>    </span><span class="annot"><span class="annottext">[(ByteString, DbModule)] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[(ByteString, DbModule)]
</span><a href="#local-6989586621679060068"><span class="hs-identifier hs-var">unitInstantiations</span></a></span><span>
</span><span id="line-534"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679060063"><span class="hs-identifier hs-var">unitAbiHash</span></a></span><span>
</span><span id="line-535"></span><span>    </span><span class="annot"><span class="annottext">[ByteString] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679060062"><span class="hs-identifier hs-var">unitDepends</span></a></span><span>
</span><span id="line-536"></span><span>    </span><span class="annot"><span class="annottext">[(ByteString, String)] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[(ByteString, String)]
</span><a href="#local-6989586621679060061"><span class="hs-identifier hs-var">unitAbiDepends</span></a></span><span>
</span><span id="line-537"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060060"><span class="hs-identifier hs-var">unitImportDirs</span></a></span><span>
</span><span id="line-538"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060059"><span class="hs-identifier hs-var">unitLibraries</span></a></span><span>
</span><span id="line-539"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060058"><span class="hs-identifier hs-var">unitExtDepLibsSys</span></a></span><span>
</span><span id="line-540"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060057"><span class="hs-identifier hs-var">unitExtDepLibsGhc</span></a></span><span>
</span><span id="line-541"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060056"><span class="hs-identifier hs-var">unitLibraryDirs</span></a></span><span>
</span><span id="line-542"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060055"><span class="hs-identifier hs-var">unitLibraryDynDirs</span></a></span><span>
</span><span id="line-543"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060054"><span class="hs-identifier hs-var">unitExtDepFrameworks</span></a></span><span>
</span><span id="line-544"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060053"><span class="hs-identifier hs-var">unitExtDepFrameworkDirs</span></a></span><span>
</span><span id="line-545"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060052"><span class="hs-identifier hs-var">unitLinkerOptions</span></a></span><span>
</span><span id="line-546"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060051"><span class="hs-identifier hs-var">unitCcOptions</span></a></span><span>
</span><span id="line-547"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060050"><span class="hs-identifier hs-var">unitIncludes</span></a></span><span>
</span><span id="line-548"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060049"><span class="hs-identifier hs-var">unitIncludeDirs</span></a></span><span>
</span><span id="line-549"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060048"><span class="hs-identifier hs-var">unitHaddockInterfaces</span></a></span><span>
</span><span id="line-550"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679060047"><span class="hs-identifier hs-var">unitHaddockHTMLs</span></a></span><span>
</span><span id="line-551"></span><span>    </span><span class="annot"><span class="annottext">[(ByteString, Maybe DbModule)] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[(ByteString, Maybe DbModule)]
</span><a href="#local-6989586621679060046"><span class="hs-identifier hs-var">unitExposedModules</span></a></span><span>
</span><span id="line-552"></span><span>    </span><span class="annot"><span class="annottext">[ByteString] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679060045"><span class="hs-identifier hs-var">unitHiddenModules</span></a></span><span>
</span><span id="line-553"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679060044"><span class="hs-identifier hs-var">unitIsIndefinite</span></a></span><span>
</span><span id="line-554"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679060043"><span class="hs-identifier hs-var">unitIsExposed</span></a></span><span>
</span><span id="line-555"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679060042"><span class="hs-identifier hs-var">unitIsTrusted</span></a></span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span>  </span><span id="local-6989586621679059976"><span class="annot"><span class="annottext">get :: Get DbUnitInfo
</span><a href="#local-6989586621679059976"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-558"></span><span>    </span><span id="local-6989586621679059975"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059975"><span class="hs-identifier hs-var">unitPackageId</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-559"></span><span>    </span><span id="local-6989586621679059974"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059974"><span class="hs-identifier hs-var">unitPackageName</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-560"></span><span>    </span><span id="local-6989586621679059973"><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679059973"><span class="hs-identifier hs-var">unitPackageVersion</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Version
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-561"></span><span>    </span><span id="local-6989586621679059972"><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679059972"><span class="hs-identifier hs-var">unitComponentName</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get (Maybe ByteString)
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-562"></span><span>    </span><span id="local-6989586621679059971"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059971"><span class="hs-identifier hs-var">unitId</span></a></span></span><span>             </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-563"></span><span>    </span><span id="local-6989586621679059970"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059970"><span class="hs-identifier hs-var">unitInstanceOf</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-564"></span><span>    </span><span id="local-6989586621679059969"><span class="annot"><span class="annottext">[(ByteString, DbModule)]
</span><a href="#local-6989586621679059969"><span class="hs-identifier hs-var">unitInstantiations</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [(ByteString, DbModule)]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-565"></span><span>    </span><span id="local-6989586621679059968"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059968"><span class="hs-identifier hs-var">unitAbiHash</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get String
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-566"></span><span>    </span><span id="local-6989586621679059967"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679059967"><span class="hs-identifier hs-var">unitDepends</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [ByteString]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-567"></span><span>    </span><span id="local-6989586621679059966"><span class="annot"><span class="annottext">[(ByteString, String)]
</span><a href="#local-6989586621679059966"><span class="hs-identifier hs-var">unitAbiDepends</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [(ByteString, String)]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-568"></span><span>    </span><span id="local-6989586621679059965"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059965"><span class="hs-identifier hs-var">unitImportDirs</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-569"></span><span>    </span><span id="local-6989586621679059964"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059964"><span class="hs-identifier hs-var">unitLibraries</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-570"></span><span>    </span><span id="local-6989586621679059963"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059963"><span class="hs-identifier hs-var">unitExtDepLibsSys</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-571"></span><span>    </span><span id="local-6989586621679059962"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059962"><span class="hs-identifier hs-var">unitExtDepLibsGhc</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-572"></span><span>    </span><span id="local-6989586621679059961"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059961"><span class="hs-identifier hs-var">libraryDirs</span></a></span></span><span>        </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-573"></span><span>    </span><span id="local-6989586621679059960"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059960"><span class="hs-identifier hs-var">libraryDynDirs</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-574"></span><span>    </span><span id="local-6989586621679059959"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059959"><span class="hs-identifier hs-var">frameworks</span></a></span></span><span>         </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-575"></span><span>    </span><span id="local-6989586621679059958"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059958"><span class="hs-identifier hs-var">frameworkDirs</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-576"></span><span>    </span><span id="local-6989586621679059957"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059957"><span class="hs-identifier hs-var">unitLinkerOptions</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-577"></span><span>    </span><span id="local-6989586621679059956"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059956"><span class="hs-identifier hs-var">unitCcOptions</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-578"></span><span>    </span><span id="local-6989586621679059955"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059955"><span class="hs-identifier hs-var">unitIncludes</span></a></span></span><span>       </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-579"></span><span>    </span><span id="local-6989586621679059954"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059954"><span class="hs-identifier hs-var">unitIncludeDirs</span></a></span></span><span>    </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-580"></span><span>    </span><span id="local-6989586621679059953"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059953"><span class="hs-identifier hs-var">unitHaddockInterfaces</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-581"></span><span>    </span><span id="local-6989586621679059952"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059952"><span class="hs-identifier hs-var">unitHaddockHTMLs</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [String]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-582"></span><span>    </span><span id="local-6989586621679059951"><span class="annot"><span class="annottext">[(ByteString, Maybe DbModule)]
</span><a href="#local-6989586621679059951"><span class="hs-identifier hs-var">unitExposedModules</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [(ByteString, Maybe DbModule)]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-583"></span><span>    </span><span id="local-6989586621679059950"><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679059950"><span class="hs-identifier hs-var">unitHiddenModules</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get [ByteString]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-584"></span><span>    </span><span id="local-6989586621679059949"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679059949"><span class="hs-identifier hs-var">unitIsIndefinite</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Bool
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-585"></span><span>    </span><span id="local-6989586621679059948"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679059948"><span class="hs-identifier hs-var">unitIsExposed</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Bool
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-586"></span><span>    </span><span id="local-6989586621679059947"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679059947"><span class="hs-identifier hs-var">unitIsTrusted</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Bool
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-587"></span><span>    </span><span class="annot"><span class="annottext">DbUnitInfo -&gt; Get DbUnitInfo
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ByteString
-&gt; ByteString
-&gt; [(ByteString, DbModule)]
-&gt; ByteString
-&gt; ByteString
-&gt; Version
-&gt; Maybe ByteString
-&gt; String
-&gt; [ByteString]
-&gt; [(ByteString, String)]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [(ByteString, Maybe DbModule)]
-&gt; [ByteString]
-&gt; Bool
-&gt; Bool
-&gt; Bool
-&gt; DbUnitInfo
forall compid srcpkgid srcpkgname uid modulename mod.
uid
-&gt; compid
-&gt; [(modulename, mod)]
-&gt; srcpkgid
-&gt; srcpkgname
-&gt; Version
-&gt; Maybe srcpkgname
-&gt; String
-&gt; [uid]
-&gt; [(uid, String)]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [String]
-&gt; [(modulename, Maybe mod)]
-&gt; [modulename]
-&gt; Bool
-&gt; Bool
-&gt; Bool
-&gt; GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
</span><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-var">GenericUnitInfo</span></a></span><span>
</span><span id="line-588"></span><span>              </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059971"><span class="hs-identifier hs-var">unitId</span></a></span><span>
</span><span id="line-589"></span><span>              </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059970"><span class="hs-identifier hs-var">unitInstanceOf</span></a></span><span>
</span><span id="line-590"></span><span>              </span><span class="annot"><span class="annottext">[(ByteString, DbModule)]
</span><a href="#local-6989586621679059969"><span class="hs-identifier hs-var">unitInstantiations</span></a></span><span>
</span><span id="line-591"></span><span>              </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059975"><span class="hs-identifier hs-var">unitPackageId</span></a></span><span>
</span><span id="line-592"></span><span>              </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059974"><span class="hs-identifier hs-var">unitPackageName</span></a></span><span>
</span><span id="line-593"></span><span>              </span><span class="annot"><span class="annottext">Version
</span><a href="#local-6989586621679059973"><span class="hs-identifier hs-var">unitPackageVersion</span></a></span><span>
</span><span id="line-594"></span><span>              </span><span class="annot"><span class="annottext">Maybe ByteString
</span><a href="#local-6989586621679059972"><span class="hs-identifier hs-var">unitComponentName</span></a></span><span>
</span><span id="line-595"></span><span>              </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059968"><span class="hs-identifier hs-var">unitAbiHash</span></a></span><span>
</span><span id="line-596"></span><span>              </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679059967"><span class="hs-identifier hs-var">unitDepends</span></a></span><span>
</span><span id="line-597"></span><span>              </span><span class="annot"><span class="annottext">[(ByteString, String)]
</span><a href="#local-6989586621679059966"><span class="hs-identifier hs-var">unitAbiDepends</span></a></span><span>
</span><span id="line-598"></span><span>              </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059965"><span class="hs-identifier hs-var">unitImportDirs</span></a></span><span>
</span><span id="line-599"></span><span>              </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059964"><span class="hs-identifier hs-var">unitLibraries</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059963"><span class="hs-identifier hs-var">unitExtDepLibsSys</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059962"><span class="hs-identifier hs-var">unitExtDepLibsGhc</span></a></span><span>
</span><span id="line-600"></span><span>              </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059961"><span class="hs-identifier hs-var">libraryDirs</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059960"><span class="hs-identifier hs-var">libraryDynDirs</span></a></span><span>
</span><span id="line-601"></span><span>              </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059959"><span class="hs-identifier hs-var">frameworks</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059958"><span class="hs-identifier hs-var">frameworkDirs</span></a></span><span>
</span><span id="line-602"></span><span>              </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059957"><span class="hs-identifier hs-var">unitLinkerOptions</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059956"><span class="hs-identifier hs-var">unitCcOptions</span></a></span><span>
</span><span id="line-603"></span><span>              </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059955"><span class="hs-identifier hs-var">unitIncludes</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059954"><span class="hs-identifier hs-var">unitIncludeDirs</span></a></span><span>
</span><span id="line-604"></span><span>              </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059953"><span class="hs-identifier hs-var">unitHaddockInterfaces</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679059952"><span class="hs-identifier hs-var">unitHaddockHTMLs</span></a></span><span>
</span><span id="line-605"></span><span>              </span><span class="annot"><span class="annottext">[(ByteString, Maybe DbModule)]
</span><a href="#local-6989586621679059951"><span class="hs-identifier hs-var">unitExposedModules</span></a></span><span>
</span><span id="line-606"></span><span>              </span><span class="annot"><span class="annottext">[ByteString]
</span><a href="#local-6989586621679059950"><span class="hs-identifier hs-var">unitHiddenModules</span></a></span><span>
</span><span id="line-607"></span><span>              </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679059949"><span class="hs-identifier hs-var">unitIsIndefinite</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679059948"><span class="hs-identifier hs-var">unitIsExposed</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679059947"><span class="hs-identifier hs-var">unitIsTrusted</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-608"></span><span>
</span><span id="line-609"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679059943"><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier hs-type">DbModule</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-610"></span><span>  </span><span id="local-6989586621679059933"><span class="annot"><span class="annottext">put :: DbModule -&gt; Put
</span><a href="#local-6989586621679059933"><span class="hs-identifier hs-var hs-var hs-var hs-var">put</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier hs-type">DbModule</span></a></span><span> </span><span id="local-6989586621679059932"><span class="annot"><span class="annottext">DbInstUnitId
</span><a href="#local-6989586621679059932"><span class="hs-identifier hs-var">dbModuleUnitId</span></a></span></span><span> </span><span id="local-6989586621679059931"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059931"><span class="hs-identifier hs-var">dbModuleName</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-611"></span><span>    </span><span class="annot"><span class="annottext">Word8 -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putWord8"><span class="hs-identifier hs-var">putWord8</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span>
</span><span id="line-612"></span><span>    </span><span class="annot"><span class="annottext">DbInstUnitId -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">DbInstUnitId
</span><a href="#local-6989586621679059932"><span class="hs-identifier hs-var">dbModuleUnitId</span></a></span><span>
</span><span id="line-613"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059931"><span class="hs-identifier hs-var">dbModuleName</span></a></span><span>
</span><span id="line-614"></span><span>  </span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#DbModuleVar"><span class="hs-identifier hs-type">DbModuleVar</span></a></span><span> </span><span id="local-6989586621679059929"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059929"><span class="hs-identifier hs-var">dbModuleVarName</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-615"></span><span>    </span><span class="annot"><span class="annottext">Word8 -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putWord8"><span class="hs-identifier hs-var">putWord8</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">1</span></span><span>
</span><span id="line-616"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059929"><span class="hs-identifier hs-var">dbModuleVarName</span></a></span><span>
</span><span id="line-617"></span><span>  </span><span id="local-6989586621679059917"><span class="annot"><span class="annottext">get :: Get DbModule
</span><a href="#local-6989586621679059917"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-618"></span><span>    </span><span id="local-6989586621679059916"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679059916"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Word8
</span><a href="../../binary/src/Data.Binary.Get.html#getWord8"><span class="hs-identifier hs-var">getWord8</span></a></span><span>
</span><span id="line-619"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679059916"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-620"></span><span>      </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">DbInstUnitId -&gt; ByteString -&gt; DbModule
</span><a href="GHC.Unit.Database.html#DbModule"><span class="hs-identifier hs-var">DbModule</span></a></span><span> </span><span class="annot"><span class="annottext">(DbInstUnitId -&gt; ByteString -&gt; DbModule)
-&gt; Get DbInstUnitId -&gt; Get (ByteString -&gt; DbModule)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get DbInstUnitId
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Get (ByteString -&gt; DbModule) -&gt; Get ByteString -&gt; Get DbModule
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-621"></span><span>      </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; DbModule
</span><a href="GHC.Unit.Database.html#DbModuleVar"><span class="hs-identifier hs-var">DbModuleVar</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; DbModule) -&gt; Get ByteString -&gt; Get DbModule
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679059911"><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#Binary"><span class="hs-identifier hs-type">Binary</span></a></span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#DbInstUnitId"><span class="hs-identifier hs-type">DbInstUnitId</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-624"></span><span>  </span><span id="local-6989586621679059900"><span class="annot"><span class="annottext">put :: DbInstUnitId -&gt; Put
</span><a href="#local-6989586621679059900"><span class="hs-identifier hs-var hs-var hs-var hs-var">put</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#DbUnitId"><span class="hs-identifier hs-type">DbUnitId</span></a></span><span> </span><span id="local-6989586621679059899"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059899"><span class="hs-identifier hs-var">uid</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-625"></span><span>    </span><span class="annot"><span class="annottext">Word8 -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putWord8"><span class="hs-identifier hs-var">putWord8</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span>
</span><span id="line-626"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059899"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-627"></span><span>  </span><span class="annot"><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Database.html#DbInstUnitId"><span class="hs-identifier hs-type">DbInstUnitId</span></a></span><span> </span><span id="local-6989586621679059898"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059898"><span class="hs-identifier hs-var">dbUnitIdComponentId</span></a></span></span><span> </span><span id="local-6989586621679059897"><span class="annot"><span class="annottext">[(ByteString, DbModule)]
</span><a href="#local-6989586621679059897"><span class="hs-identifier hs-var">dbUnitIdInsts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-628"></span><span>    </span><span class="annot"><span class="annottext">Word8 -&gt; Put
</span><a href="../../binary/src/Data.Binary.Put.html#putWord8"><span class="hs-identifier hs-var">putWord8</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">1</span></span><span>
</span><span id="line-629"></span><span>    </span><span class="annot"><span class="annottext">ByteString -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679059898"><span class="hs-identifier hs-var">dbUnitIdComponentId</span></a></span><span>
</span><span id="line-630"></span><span>    </span><span class="annot"><span class="annottext">[(ByteString, DbModule)] -&gt; Put
forall t. Binary t =&gt; t -&gt; Put
</span><a href="../../binary/src/Data.Binary.Class.html#put"><span class="hs-identifier hs-var">put</span></a></span><span> </span><span class="annot"><span class="annottext">[(ByteString, DbModule)]
</span><a href="#local-6989586621679059897"><span class="hs-identifier hs-var">dbUnitIdInsts</span></a></span><span>
</span><span id="line-631"></span><span>
</span><span id="line-632"></span><span>  </span><span id="local-6989586621679059885"><span class="annot"><span class="annottext">get :: Get DbInstUnitId
</span><a href="#local-6989586621679059885"><span class="hs-identifier hs-var hs-var hs-var hs-var">get</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-633"></span><span>    </span><span id="local-6989586621679059884"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679059884"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Get Word8
</span><a href="../../binary/src/Data.Binary.Get.html#getWord8"><span class="hs-identifier hs-var">getWord8</span></a></span><span>
</span><span id="line-634"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679059884"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-635"></span><span>      </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; DbInstUnitId
</span><a href="GHC.Unit.Database.html#DbUnitId"><span class="hs-identifier hs-var">DbUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; DbInstUnitId) -&gt; Get ByteString -&gt; Get DbInstUnitId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-636"></span><span>      </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; [(ByteString, DbModule)] -&gt; DbInstUnitId
</span><a href="GHC.Unit.Database.html#DbInstUnitId"><span class="hs-identifier hs-var">DbInstUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; [(ByteString, DbModule)] -&gt; DbInstUnitId)
-&gt; Get ByteString -&gt; Get ([(ByteString, DbModule)] -&gt; DbInstUnitId)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get ByteString
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Get ([(ByteString, DbModule)] -&gt; DbInstUnitId)
-&gt; Get [(ByteString, DbModule)] -&gt; Get DbInstUnitId
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Get [(ByteString, DbModule)]
forall t. Binary t =&gt; Get t
</span><a href="../../binary/src/Data.Binary.Class.html#get"><span class="hs-identifier hs-var">get</span></a></span><span>
</span><span id="line-637"></span><span>
</span><span id="line-638"></span><span>
</span><span id="line-639"></span><span class="hs-comment">-- | Return functions to perform path/URL variable substitution as per the Cabal</span><span>
</span><span id="line-640"></span><span class="hs-comment">-- ${pkgroot} spec</span><span>
</span><span id="line-641"></span><span class="hs-comment">-- (http://www.haskell.org/pipermail/libraries/2009-May/011772.html)</span><span>
</span><span id="line-642"></span><span class="hs-comment">--</span><span>
</span><span id="line-643"></span><span class="hs-comment">-- Paths/URLs can be relative to ${pkgroot} or ${pkgrooturl}.</span><span>
</span><span id="line-644"></span><span class="hs-comment">-- The &quot;pkgroot&quot; is the directory containing the package database.</span><span>
</span><span id="line-645"></span><span class="hs-comment">--</span><span>
</span><span id="line-646"></span><span class="hs-comment">-- Also perform a similar substitution for the older GHC-specific</span><span>
</span><span id="line-647"></span><span class="hs-comment">-- &quot;$topdir&quot; variable. The &quot;topdir&quot; is the location of the ghc</span><span>
</span><span id="line-648"></span><span class="hs-comment">-- installation (obtained from the -B option).</span><span>
</span><span id="line-649"></span><span class="annot"><a href="GHC.Unit.Database.html#mkMungePathUrl"><span class="hs-identifier hs-type">mkMungePathUrl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-650"></span><span id="mkMungePathUrl"><span class="annot"><span class="annottext">mkMungePathUrl :: String -&gt; String -&gt; (ShowS, ShowS)
</span><a href="GHC.Unit.Database.html#mkMungePathUrl"><span class="hs-identifier hs-var hs-var">mkMungePathUrl</span></a></span></span><span> </span><span id="local-6989586621679059883"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059883"><span class="hs-identifier hs-var">top_dir</span></a></span></span><span> </span><span id="local-6989586621679059882"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059882"><span class="hs-identifier hs-var">pkgroot</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShowS
</span><a href="#local-6989586621679059881"><span class="hs-identifier hs-var">munge_path</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ShowS
</span><a href="#local-6989586621679059880"><span class="hs-identifier hs-var">munge_url</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-651"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-652"></span><span>    </span><span id="local-6989586621679059881"><span class="annot"><span class="annottext">munge_path :: ShowS
</span><a href="#local-6989586621679059881"><span class="hs-identifier hs-var hs-var">munge_path</span></a></span></span><span> </span><span id="local-6989586621679059879"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059879"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-653"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679059878"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059878"><span class="hs-identifier hs-var">p'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Maybe String
</span><a href="#local-6989586621679059877"><span class="hs-identifier hs-var">stripVarPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;${pkgroot}&quot;</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059879"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059882"><span class="hs-identifier hs-var">pkgroot</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059878"><span class="hs-identifier hs-var">p'</span></a></span><span>
</span><span id="line-654"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679059876"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059876"><span class="hs-identifier hs-var">p'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Maybe String
</span><a href="#local-6989586621679059877"><span class="hs-identifier hs-var">stripVarPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;$topdir&quot;</span></span><span>    </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059879"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059883"><span class="hs-identifier hs-var">top_dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059876"><span class="hs-identifier hs-var">p'</span></a></span><span>
</span><span id="line-655"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059879"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-656"></span><span>
</span><span id="line-657"></span><span>    </span><span id="local-6989586621679059880"><span class="annot"><span class="annottext">munge_url :: ShowS
</span><a href="#local-6989586621679059880"><span class="hs-identifier hs-var hs-var">munge_url</span></a></span></span><span> </span><span id="local-6989586621679059875"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059875"><span class="hs-identifier hs-var">p</span></a></span></span><span>
</span><span id="line-658"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679059874"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059874"><span class="hs-identifier hs-var">p'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Maybe String
</span><a href="#local-6989586621679059877"><span class="hs-identifier hs-var">stripVarPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;${pkgrooturl}&quot;</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059875"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="#local-6989586621679059873"><span class="hs-identifier hs-var">toUrlPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059882"><span class="hs-identifier hs-var">pkgroot</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059874"><span class="hs-identifier hs-var">p'</span></a></span><span>
</span><span id="line-659"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679059872"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059872"><span class="hs-identifier hs-var">p'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Maybe String
</span><a href="#local-6989586621679059877"><span class="hs-identifier hs-var">stripVarPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;$httptopdir&quot;</span></span><span>   </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059875"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="#local-6989586621679059873"><span class="hs-identifier hs-var">toUrlPath</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059883"><span class="hs-identifier hs-var">top_dir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059872"><span class="hs-identifier hs-var">p'</span></a></span><span>
</span><span id="line-660"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059875"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-661"></span><span>
</span><span id="line-662"></span><span>    </span><span id="local-6989586621679059873"><span class="annot"><span class="annottext">toUrlPath :: String -&gt; ShowS
</span><a href="#local-6989586621679059873"><span class="hs-identifier hs-var hs-var">toUrlPath</span></a></span></span><span> </span><span id="local-6989586621679059869"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059869"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679059868"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059868"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;file:///&quot;</span></span><span>
</span><span id="line-663"></span><span>                 </span><span class="hs-comment">-- URLs always use posix style '/' separators:</span><span>
</span><span id="line-664"></span><span>                 </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; String
</span><a href="../../filepath/src/System.FilePath.Posix.html#joinPath"><span class="hs-identifier hs-var">FilePath.Posix.joinPath</span></a></span><span>
</span><span id="line-665"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059869"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="hs-comment">-- We need to drop a leading &quot;/&quot; or &quot;\\&quot;</span><span>
</span><span id="line-666"></span><span>                             </span><span class="hs-comment">-- if there is one:</span><span>
</span><span id="line-667"></span><span>                             </span><span class="annot"><span class="annottext">(String -&gt; Bool) -&gt; [String] -&gt; [String]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#dropWhile"><span class="hs-identifier hs-var">dropWhile</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Char -&gt; Bool) -&gt; String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isPathSeparator"><span class="hs-identifier hs-var">isPathSeparator</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-668"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String]
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitDirectories"><span class="hs-identifier hs-var">FilePath.splitDirectories</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059868"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-669"></span><span>
</span><span id="line-670"></span><span>    </span><span class="hs-comment">-- We could drop the separator here, and then use &lt;/&gt; above. However,</span><span>
</span><span id="line-671"></span><span>    </span><span class="hs-comment">-- by leaving it in and using ++ we keep the same path separator</span><span>
</span><span id="line-672"></span><span>    </span><span class="hs-comment">-- rather than letting FilePath change it to use \ as the separator</span><span>
</span><span id="line-673"></span><span>    </span><span id="local-6989586621679059877"><span class="annot"><span class="annottext">stripVarPrefix :: String -&gt; String -&gt; Maybe String
</span><a href="#local-6989586621679059877"><span class="hs-identifier hs-var hs-var">stripVarPrefix</span></a></span></span><span> </span><span id="local-6989586621679059861"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059861"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span id="local-6989586621679059860"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059860"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Maybe String
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Maybe [a]
</span><a href="../../base/src/Data.OldList.html#stripPrefix"><span class="hs-identifier hs-var">stripPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059861"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059860"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-674"></span><span>                              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-675"></span><span>                              </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679059859"><span class="annot"><span class="annottext">cs :: String
</span><a href="#local-6989586621679059859"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679059858"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679059858"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Bool
</span><a href="../../filepath/src/System.FilePath.Windows.html#isPathSeparator"><span class="hs-identifier hs-var">isPathSeparator</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679059858"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059859"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-676"></span><span>                              </span><span class="annot"><span class="annottext">Maybe String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-677"></span><span>
</span><span id="line-678"></span><span>
</span><span id="line-679"></span><span class="hs-comment">-- | Perform path/URL variable substitution as per the Cabal ${pkgroot} spec</span><span>
</span><span id="line-680"></span><span class="hs-comment">-- (http://www.haskell.org/pipermail/libraries/2009-May/011772.html)</span><span>
</span><span id="line-681"></span><span class="hs-comment">-- Paths/URLs can be relative to ${pkgroot} or ${pkgrooturl}.</span><span>
</span><span id="line-682"></span><span class="hs-comment">-- The &quot;pkgroot&quot; is the directory containing the package database.</span><span>
</span><span id="line-683"></span><span class="hs-comment">--</span><span>
</span><span id="line-684"></span><span class="hs-comment">-- Also perform a similar substitution for the older GHC-specific</span><span>
</span><span id="line-685"></span><span class="hs-comment">-- &quot;$topdir&quot; variable. The &quot;topdir&quot; is the location of the ghc</span><span>
</span><span id="line-686"></span><span class="hs-comment">-- installation (obtained from the -B option).</span><span>
</span><span id="line-687"></span><span id="local-6989586621679060741"><span id="local-6989586621679060742"><span id="local-6989586621679060743"><span id="local-6989586621679060744"><span id="local-6989586621679060745"><span id="local-6989586621679060746"><span class="annot"><a href="GHC.Unit.Database.html#mungeUnitInfoPaths"><span class="hs-identifier hs-type">mungeUnitInfoPaths</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060746"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060745"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060744"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060743"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060742"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060741"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Database.html#GenericUnitInfo"><span class="hs-identifier hs-type">GenericUnitInfo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060746"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060745"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060744"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060743"><span class="hs-identifier hs-type">d</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060742"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679060741"><span class="hs-identifier hs-type">f</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-688"></span><span id="mungeUnitInfoPaths"><span class="annot"><span class="annottext">mungeUnitInfoPaths :: forall a b c d e f.
String
-&gt; String
-&gt; GenericUnitInfo a b c d e f
-&gt; GenericUnitInfo a b c d e f
</span><a href="GHC.Unit.Database.html#mungeUnitInfoPaths"><span class="hs-identifier hs-var hs-var">mungeUnitInfoPaths</span></a></span></span><span> </span><span id="local-6989586621679059857"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059857"><span class="hs-identifier hs-var">top_dir</span></a></span></span><span> </span><span id="local-6989586621679059856"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059856"><span class="hs-identifier hs-var">pkgroot</span></a></span></span><span> </span><span id="local-6989586621679059855"><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-689"></span><span>   </span><span class="hs-comment">-- TODO: similar code is duplicated in utils/ghc-pkg/Main.hs</span><span>
</span><span id="line-690"></span><span>    </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span>
</span><span id="line-691"></span><span>      </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">unitImportDirs :: [String]
</span><a href="GHC.Unit.Database.html#unitImportDirs"><span class="hs-identifier hs-var">unitImportDirs</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var">munge_paths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitImportDirs"><span class="hs-identifier hs-var hs-var">unitImportDirs</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-692"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitIncludeDirs :: [String]
</span><a href="GHC.Unit.Database.html#unitIncludeDirs"><span class="hs-identifier hs-var">unitIncludeDirs</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var">munge_paths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitIncludeDirs"><span class="hs-identifier hs-var hs-var">unitIncludeDirs</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitLibraryDirs :: [String]
</span><a href="GHC.Unit.Database.html#unitLibraryDirs"><span class="hs-identifier hs-var">unitLibraryDirs</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var">munge_paths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitLibraryDirs"><span class="hs-identifier hs-var hs-var">unitLibraryDirs</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-694"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitLibraryDynDirs :: [String]
</span><a href="GHC.Unit.Database.html#unitLibraryDynDirs"><span class="hs-identifier hs-var">unitLibraryDynDirs</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var">munge_paths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitLibraryDynDirs"><span class="hs-identifier hs-var hs-var">unitLibraryDynDirs</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitExtDepFrameworkDirs :: [String]
</span><a href="GHC.Unit.Database.html#unitExtDepFrameworkDirs"><span class="hs-identifier hs-var">unitExtDepFrameworkDirs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var">munge_paths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitExtDepFrameworkDirs"><span class="hs-identifier hs-var hs-var">unitExtDepFrameworkDirs</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-696"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitHaddockInterfaces :: [String]
</span><a href="GHC.Unit.Database.html#unitHaddockInterfaces"><span class="hs-identifier hs-var">unitHaddockInterfaces</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var">munge_paths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitHaddockInterfaces"><span class="hs-identifier hs-var hs-var">unitHaddockInterfaces</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-697"></span><span>        </span><span class="hs-comment">-- haddock-html is allowed to be either a URL or a file</span><span>
</span><span id="line-698"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">unitHaddockHTMLs :: [String]
</span><a href="GHC.Unit.Database.html#unitHaddockHTMLs"><span class="hs-identifier hs-var">unitHaddockHTMLs</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var">munge_paths</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; [String]
</span><a href="#local-6989586621679059853"><span class="hs-identifier hs-var">munge_urls</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="GHC.Unit.Database.html#unitHaddockHTMLs"><span class="hs-identifier hs-var hs-var">unitHaddockHTMLs</span></a></span><span> </span><span class="annot"><span class="annottext">GenericUnitInfo a b c d e f
</span><a href="#local-6989586621679059855"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-699"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-700"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-701"></span><span>      </span><span id="local-6989586621679059854"><span class="annot"><span class="annottext">munge_paths :: [String] -&gt; [String]
</span><a href="#local-6989586621679059854"><span class="hs-identifier hs-var hs-var">munge_paths</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShowS -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ShowS
</span><a href="#local-6989586621679059852"><span class="hs-identifier hs-var">munge_path</span></a></span><span>
</span><span id="line-702"></span><span>      </span><span id="local-6989586621679059853"><span class="annot"><span class="annottext">munge_urls :: [String] -&gt; [String]
</span><a href="#local-6989586621679059853"><span class="hs-identifier hs-var hs-var">munge_urls</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShowS -&gt; [String] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ShowS
</span><a href="#local-6989586621679059851"><span class="hs-identifier hs-var">munge_url</span></a></span><span>
</span><span id="line-703"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621679059852"><span class="annot"><span class="annottext">ShowS
</span><a href="#local-6989586621679059852"><span class="hs-identifier hs-var">munge_path</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679059851"><span class="annot"><span class="annottext">ShowS
</span><a href="#local-6989586621679059851"><span class="hs-identifier hs-var">munge_url</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; (ShowS, ShowS)
</span><a href="GHC.Unit.Database.html#mkMungePathUrl"><span class="hs-identifier hs-var">mkMungePathUrl</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059857"><span class="hs-identifier hs-var">top_dir</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679059856"><span class="hs-identifier hs-var">pkgroot</span></a></span><span>
</span><span id="line-704"></span></pre></body></html>